Skip to content

Commit f2a27ad

Browse files
committed
gcc backend: pass '-Wno-format' to gcc backend
- pass '-Wno-format' to prevent format string errors in gcc 9.x (enabled by default with -Wall) (cherry picked from commit eaa67f5)
1 parent b7805a8 commit f2a27ad

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Version 1.07.1
1414

1515
[fixed]
1616
- makefile: under MSYS2 (and friends), TARGET_ARCH is now identified from shell's default target architecture instead of shell's host architecture
17+
- gcc backend: pass '-Wno-format' to prevent format string errors in gcc 9.x (enabled by default with -Wall)
1718

1819

1920
Version 1.07.0

src/compiler/fbc.bas

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2939,6 +2939,13 @@ private function hCompileStage2Module( byval module as FBCIOFILE ptr ) as intege
29392939
'' Avoid gcc exception handling bloat
29402940
ln += "-fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables "
29412941

2942+
'' Prevent format string errors on gcc 9.x. (enabled by default with '-Wall')
2943+
'' TODO: fbc currently emits the ZSTRING type as 'uint8' when it
2944+
'' should probably preserve the 'char' type. In C, there are 3
2945+
'' distinct types, 'char', 'unsigned char', 'signed char'.
2946+
'' See ir-hlc.bas:hEmitType()
2947+
ln += "-Wno-format "
2948+
29422949
if( fbGetOption( FB_COMPOPT_DEBUGINFO ) ) then
29432950
ln += "-g "
29442951
end if

0 commit comments

Comments
 (0)