Skip to content

Commit 13b4de3

Browse files
committed
fbdoc: udpate tools
- doc/fbchkdoc/mkerrlst.bas fills in the text for Ambiguous LEN or SIZE of messsage - examples/manual/samples.bas accepts option to pass on addition compiler options to fbc - small fix in compiler/error.bas message - small fix to enable '-forcelang <lang>' compiler option
1 parent 5b8451d commit 13b4de3

File tree

4 files changed

+21
-6
lines changed

4 files changed

+21
-6
lines changed

doc/fbchkdoc/mkerrlst.bas

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,14 @@ end sub
3131
''
3232
sub WriteFooterCode( byval h as integer )
3333
print #h, !"print"
34+
print #h, !"dim msg as string"
3435
print #h, !"for i as integer = 1 to FB_WARNINGMSGS-1"
35-
print #h, !"print chr(9) + \"- //\" + ltrim(str(i)) + \" \" + *warningMsgs(i).text + \"//\""
36+
print #h, !"if i = FB_WARNINGMSG_AMBIGIOUSLENSIZEOF then"
37+
print #h, !"msg = ""Ambiguous LEN or SIZEOF"""
38+
print #h, !"else"
39+
print #h, !"msg = *warningMsgs(i).text"
40+
print #h, !"end if"
41+
print #h, !"print chr(9) + \"- //\" + ltrim(str(i)) + \" \" + msg + \"//\""
3642
print #h, !"next"
3743
print #h, !"print: print: print"
3844
print #h, !"for i as integer = 1 to FB_ERRMSGS-1"

examples/manual/samples.bas

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,8 @@ function DoCompile _
390390
byref sourcedir as string, _
391391
byref fbc as string, _
392392
byref source as string, _
393-
byref target as string _
393+
byref target as string, _
394+
byref opts as string _
394395
) as integer
395396

396397
dim i as integer
@@ -409,7 +410,7 @@ function DoCompile _
409410

410411
args = sourcedir & source
411412

412-
args += " -x " & sourcedir & target
413+
args += " " & opts & " -x " & sourcedir & target
413414

414415
print fbc & " " & args
415416
ret = exec( fbc, args )
@@ -662,6 +663,7 @@ dim opt_specialonly as integer
662663
dim dirs() as string, ndirs as integer
663664
dim files() as string, nfiles as integer
664665
dim haderror as integer
666+
dim extra_opts as string = ""
665667

666668
ndirs = 0
667669
nfiles = 0
@@ -711,6 +713,9 @@ case else
711713
print " -error"
712714
print " Abort on first error detected"
713715
print
716+
print " -opts options"
717+
print " Add options to the command line"
718+
print
714719
end
715720
end select
716721

@@ -735,6 +740,10 @@ while( command(i) > "" )
735740

736741
case "-error"
737742
opt_error = TRUE
743+
744+
case "-opts"
745+
i += 1
746+
extra_opts = command(i)
738747

739748
case else
740749
print "Unrecognized option '" & command(i) & "'"
@@ -813,7 +822,7 @@ case CMD_COMPILE, CMD_CLEAN
813822
target = left(files(i), len(files(i))-4) & exe_ext
814823

815824
if( cmd = CMD_COMPILE ) then
816-
if( DoCompile( sourcedir, fbc, files(i), target ) = BUILD_FAIL ) then
825+
if( DoCompile( sourcedir, fbc, files(i), target, extra_opts ) = BUILD_FAIL ) then
817826
haderror = TRUE
818827
if( opt_error ) then
819828
exit for

src/compiler/error.bas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ declare function hMakeParamDesc _
5252
( 1, @"Identifier's name too big, truncated" ), _
5353
( 1, @"Literal number too big, truncated" ), _
5454
( 1, @"Literal string too big, truncated" ), _
55-
( 0, @"UDT with pointer or var-len string fields" ), _
55+
( 0, @"UDT with pointer, var-len string, or var-len array fields" ), _
5656
( 0, @"Implicit variable allocation" ), _
5757
( 0, @"Missing closing quote in literal string" ), _
5858
( 0, @"Function result was not explicitly set" ), _

src/compiler/fbc.bas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ dim shared as integer option_takes_argument(0 to (OPT__COUNT - 1)) = _
14621462
FALSE, _ '' OPT_EX
14631463
FALSE, _ '' OPT_EXX
14641464
FALSE, _ '' OPT_EXPORT
1465-
FALSE, _ '' OPT_FORCELANG
1465+
TRUE, _ '' OPT_FORCELANG
14661466
TRUE , _ '' OPT_FPMODE
14671467
TRUE , _ '' OPT_FPU
14681468
FALSE, _ '' OPT_G

0 commit comments

Comments
 (0)