Opened 7 years ago

Closed 5 years ago

Last modified 5 years ago

#1539 closed task (fixed (in master))

Remove warnings from all compiler platforms

Reported by: magnate Owned by:
Milestone: 3.5.0 Keywords: cleanup
Cc:

Description (last modified by magnate)

None of these warnings appear in the basic linux build environment, but they all ought to be fixed nonetheless:

On any Windows build (cross-compile in Linux or native):

z-file.c: In function ‘file_open’:
z-file.c:381: warning: implicit declaration of function ‘fdopen’
z-file.c:381: warning: assignment makes pointer from integer without a cast

On cygwin, building the gcu version:

parser.c: In function ‘parser_parse’:
parser.c:261:2: warning: array subscript has type ‘char’

z-file.c: In function ‘file_open’:
z-file.c:389:6: warning: implicit declaration of function ‘fdopen’
z-file.c:389:12: warning: assignment makes pointer from integer without a cast
z-file.c: In function ‘file_lock’:
z-file.c:450:2: warning: implicit declaration of function ‘fileno’

z-form.c: In function ‘vstrnfmt’:
z-form.c:553:5: warning: array subscript has type ‘char’
z-form.c:556:6: warning: array subscript has type ‘char’
z-form.c:557:7: warning: array subscript has type ‘char’

main-gcu.c: In function ‘Term_text_gcu’:
main-gcu.c:698:2: warning: implicit declaration of function ‘mvwaddnwstr’
main-gcu.c: In function ‘init_gcu’:
main-gcu.c:803:3: warning: implicit declaration of function ‘putenv’

Change History (9)

comment:1 Changed 7 years ago by magnate

  • Description modified (diff)
  • Status changed from new to confirmed

comment:2 Changed 7 years ago by magnate

  • Description modified (diff)

comment:3 Changed 7 years ago by magnate

These ones *do* occur in Linux, and are new (post-UTF8 merge):

main-gcu.c: In function ‘init_gcu’:
main-gcu.c:771:7: warning: variable ‘graphics’ set but not used [-Wunused-but-set-variable]
Successfully compiled main-gcu.c.
gtk/main-gtk.c: In function ‘term_data_init’:
gtk/main-gtk.c:2059:15: warning: assignment from incompatible pointer type [enabled by default]
gtk/main-gtk.c:2062:15: warning: assignment from incompatible pointer type [enabled by default]
Successfully compiled gtk/main-gtk.c.

comment:4 Changed 7 years ago by magnate

  • Description modified (diff)

On Linux, no warnings in master or v4-master for normal building. For cross-building with mingw32, this warning occurs in master but not v4-master:

borg/borg9.c: In function ‘borg_write_map’:
borg/borg9.c:4844: warning: ‘borg_map_file’ may be used uninitialized in this function

I think the cygwin errors can be ignored, as our supported build environment for Windows is mingw/msys.

comment:5 Changed 6 years ago by magnate

Ok, we now have two warnings in master when cross-building for Windows from Linux:

borg/borg9.c: In function ‘borg_inkey_hack’:
borg/borg9.c:3343: warning: dereferencing type-punned pointer will break strict-aliasing rules
borg/borg9.c: In function ‘borg_write_map’:
borg/borg9.c:4844: warning: ‘borg_map_file’ may be used uninitialized in this function

Still no warnings for Linux builds.

comment:6 Changed 6 years ago by magnate

Ok, three Windows warnings on the autobuilders:

main-win.c:3275: warning: comparison between signed and unsigned
./h-basic.h:166:1: warning: "TRUE" redefined
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/windef.h:55:1: warning: this is the location of the previous definition
./h-basic.h:167:1: warning: "FALSE" redefined
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/windef.h:52:1: warning: this is the location of the previous definition

The two redefines were caused by Nomad IIRC. I think it's best if we go through and ensure consistency, using TRUE rather than true.

Lots of warnings on OSX:

main-crb.c:451: warning: 'FSpGetFInfo' is deprecated (declared at /System/Library/Frameworks/CoreServices?.framework/Frameworks/CarbonCore.framework/Headers/Files.h:10207)
main-crb.c:456: warning: 'FSpSetFInfo' is deprecated (declared at /System/Library/Frameworks/CoreServices?.framework/Frameworks/CarbonCore.framework/Headers/Files.h:10225)
main-crb.c:591: warning: 'GetPortBounds?' is deprecated (declared at /System/Library/Frameworks/ApplicationServices?.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:4527)
main-crb.c:843: warning: 'GetQDGlobalsScreenBits' is deprecated (declared at /System/Library/Frameworks/ApplicationServices?.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:5400)
main-crb.c:1126: warning: pointer targets in passing argument 1 of 'wcstombs' differ in signedness
main-crb.c:1138: warning: unused variable 'text_len'
main-crb.c:3714: warning: 'SetCursor?' is deprecated (declared at /System/Library/Frameworks/ApplicationServices?.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:595)
main-crb.c:3714: warning: 'GetQDGlobalsArrow' is deprecated (declared at /System/Library/Frameworks/ApplicationServices?.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:5415)
main-crb.c:3756: warning: 'FSpGetFInfo' is deprecated (declared at /System/Library/Frameworks/CoreServices?.framework/Frameworks/CarbonCore.framework/Headers/Files.h:10207)
main-crb.c:4027: warning: 'SetCursor?' is deprecated (declared at /System/Library/Frameworks/ApplicationServices?.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:595)
main-crb.c:4027: warning: 'GetCursor?' is deprecated (declared at /System/Library/Frameworks/ApplicationServices?.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:3886)
main-crb.c:4058: warning: 'SetCursor?' is deprecated (declared at /System/Library/Frameworks/ApplicationServices?.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:595)
main-crb.c:4058: warning: 'GetQDGlobalsArrow' is deprecated (declared at /System/Library/Frameworks/ApplicationServices?.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:5415)
main-crb.c:451: warning: 'FSpGetFInfo' is deprecated (declared at /System/Library/Frameworks/CoreServices?.framework/Frameworks/CarbonCore.framework/Headers/Files.h:10207)
main-crb.c:456: warning: 'FSpSetFInfo' is deprecated (declared at /System/Library/Frameworks/CoreServices?.framework/Frameworks/CarbonCore.framework/Headers/Files.h:10225)
main-crb.c:591: warning: 'GetPortBounds?' is deprecated (declared at /System/Library/Frameworks/ApplicationServices?.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:4527)
main-crb.c:843: warning: 'GetQDGlobalsScreenBits' is deprecated (declared at /System/Library/Frameworks/ApplicationServices?.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:5400)
main-crb.c:1126: warning: pointer targets in passing argument 1 of 'wcstombs' differ in signedness
main-crb.c:1138: warning: unused variable 'text_len'
main-crb.c:3714: warning: 'SetCursor?' is deprecated (declared at /System/Library/Frameworks/ApplicationServices?.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:595)
main-crb.c:3714: warning: 'GetQDGlobalsArrow' is deprecated (declared at /System/Library/Frameworks/ApplicationServices?.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:5415)
main-crb.c:3756: warning: 'FSpGetFInfo' is deprecated (declared at /System/Library/Frameworks/CoreServices?.framework/Frameworks/CarbonCore.framework/Headers/Files.h:10207)
main-crb.c:4027: warning: 'SetCursor?' is deprecated (declared at /System/Library/Frameworks/ApplicationServices?.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:595)
main-crb.c:4027: warning: 'GetCursor?' is deprecated (declared at /System/Library/Frameworks/ApplicationServices?.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:3886)
main-crb.c:4058: warning: 'SetCursor?' is deprecated (declared at /System/Library/Frameworks/ApplicationServices?.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:595)
main-crb.c:4058: warning: 'GetQDGlobalsArrow' is deprecated (declared at /System/Library/Frameworks/ApplicationServices?.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:5415)

... all in main-crb.c (does the autobuilder build main-cocoa?).

comment:7 Changed 6 years ago by magnate

Ok, this warning:

main-win.c:3278: warning: comparison between signed and unsigned

appears when the autobuilders build for Windows (on Linux, using mingw), but not when I do it manually (using an identical invocation). I don't know what's going on here.

comment:8 Changed 6 years ago by magnate

  • Milestone changed from 3.4.0 to 3.5.0

Moved to 3.5.0 with a genuine intention to fix them by then.

comment:9 Changed 5 years ago by takkaria

  • Resolution set to fixed (in master)
  • Status changed from confirmed to closed

All fixable autobuilder warnings are now fixed. Added note about checking for warnings to ReleaseChecklist. main-crb problems aren't fixed but they can't be and Cocoa will replace it soon enough.

Last edited 5 years ago by takkaria (previous) (diff)
Note: See TracTickets for help on using tickets.