bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Warning when compiling GNUstep


From: Richard Frith-Macdonald
Subject: Re: Warning when compiling GNUstep
Date: Mon, 28 Jul 2003 18:10:17 +0100


On Monday, July 28, 2003, at 04:52 PM, Yen-Ju Chen wrote:

These are the warnings I received when compiling GNUstep.
GNUstep still works, but compilation will looks more clean if they are fixed.
I use FreeBSD 4.8, GCC 3.2 with lastest GNUstep CVS (7/28 morning).

Almost entirely these warnings are the compiler being stupid ...
Often they don't appear when built with 'debug=yes' since the compiler
then maintains more information about what it is doing, and can tell that
some of these things are ok.

gnustep-base:

GSMime.m: In function `-[GSMimeParser decodeData:fromRange:intoData:withContext:]': GSMime.m:780: warning: `src' might be used uninitialized in this function
GSMime.m: In function `-[GSMimeDocument rawMimeData:]':
GSMime.m:3853: warning: `boundary' might be used uninitialized in this function
Unicode.m: In function `GSEncodingFromLocale':
Unicode.m:450: warning: `encoding' might be used uninitialized in this function
Unicode.m: In function `GSToUnicode':
Unicode.m:1288: warning: passing arg 2 of `iconv' from incompatible pointer type
Unicode.m: In function `GSFromUnicode':
Unicode.m:1882: warning: passing arg 2 of `iconv' from incompatible pointer type NSCalendarDate.m: In function `-[NSCalendarDate(OPENSTEP) years:months:days:hours:minutes:seconds:sinceDate:]': NSCalendarDate.m:2169: warning: `tmp' might be used uninitialized in this function NSRunLoop.m: In function `-[NSRunLoop(GNUstepExtensions) addEvent:type:watcher:forMode:]': NSRunLoop.m:1532: warning: comparison of distinct pointer types lacks a cast
NSURL.m: In function `unescape':
NSURL.m:406: warning: `c' might be used uninitialized in this function
externs.m: In function `GSBuildStrings':
externs.m:211: warning: multiple declarations for method `initialize'
/usr/local/lib/gcc-lib/i386-portbld-freebsd4.8/3.2.2/include/objc/ Object.h:43: warning: using `+initialize' ../Headers/Foundation/NSObject.h:167: warning: also found `+(void)initialize'
Compiling file objc-load.m ...
dynamic-load.h:54: warning: `__objc_dynamic_find_symbol' defined but not used

Most of these, I added tweaks to avoid the warnings, where I could do so without
making the code less efficient.

AGSHtml.m: In function `-[AGSHtml outputNode:to:]':
AGSHtml.m:1581: warning: unused variable `tmp'

Some unimplemented functionality ... so the warning is probably a good reminder.

gdnc.m: In function `-[GDNCServer registerClient:]':
gdnc.m:568: warning: method `isProxy' not implemented by protocol
gdnc.m:572: warning: method `setProtocolForProxy:' not implemented by protocol

Compiler bug ... The code already uses explicit casts to tell the compiler what it's doing ...
Upgrading to a more recent compiler should fix that.

plmerge.m: In function `main':
plmerge.m:39: warning: `plist' might be used uninitialized in this function

gnustep-gui:

NSOpenGLContext.m: In function `+[NSOpenGLContext currentContext]':
NSOpenGLContext.m:68: warning: multiple declarations for method `currentContext' ../Headers/AppKit/NSOpenGL.h:95: warning: using `+(NSOpenGLContext *)currentContext' ../Headers/AppKit/NSGraphicsContext.h:168: warning: also found `+(NSGraphicsContext *)currentContext'
NSScroller.m: In function `-[NSScroller trackKnob:]':
NSScroller.m:598: warning: `presentEvent' might be used uninitialized in this function
NSSound.m:86: warning: `the_server' defined but not used
NSTextView.m:2258: warning: incomplete implementation of class `NSTextView' NSTextView.m:2258: warning: method definition for `-selectedRange' not found NSTextView.m:2258: warning: class `NSTextView' does not fully implement the `NSTextInput' protocol GSHorizontalTypesetter.m: In function `-[GSHorizontalTypesetter layoutGlyphsInLayoutManager:inTextContainer:startingAtGlyphIndex:previo usLineFragmentRect:nextGlyphIndex:numberOfLineFragments:]': GSHorizontalTypesetter.m:1100: warning: `ret' might be used uninitialized in this function NSPasteboard.m: In function `-[GSFiltered pasteboard:provideDataForType:]': NSPasteboard.m:663: warning: `info' might be used uninitialized in this function NSPasteboard.m:803: warning: `d' might be used uninitialized in this function
NSPasteboard.m: In function `+[NSPasteboard pasteboardWithName:]':
NSPasteboard.m:1188: warning: method `isProxy' not implemented by protocol NSPasteboard.m:1192: warning: method `setProtocolForProxy:' not implemented by protocol
NSPasteboard.m: In function `+[NSPasteboard(Private) _pbs]':
NSPasteboard.m:1944: warning: method `retain' not implemented by protocol NSPasteboard.m:1946: warning: method `connectionForProxy' not implemented by protocol NSPasteboard.m:1949: warning: method `setProtocolForProxy:' not implemented by protocol NSPasteboard.m: In function `+[NSPasteboard(Private) _pasteboardWithTarget:name:]': NSPasteboard.m:2030: warning: comparison of distinct pointer types lacks a cast NSPasteboard.m:2033: warning: method `retain' not implemented by protocol NSPasteboard.m:2045: warning: method `retain' not implemented by protocol

I think most of the above are due to the compiler bug handling casts and protocols ...
upgrading the compiler should fix.

gnustep-back (with backart):

XGServerEvent.m: In function `-[XGServer(X11Methods) receivedEvent:type:extra:forMode:]': XGServerEvent.m:1265: warning: `NSGraphicsContext' does not respond to `gotShmCompletion:'
XGDragView.m: In function `-[XGDragView _setCursor]':
XGDragView.m:456: warning: `iname' might be used uninitialized in this function
blit.m:1348:2: warning: #warning RGB
blit.m:1374:2: warning: #warning BGR
blit.m:1400:2: warning: #warning RGBA
blit.m:1434:2: warning: #warning BGRA
blit.m:1468:2: warning: #warning ARGB
blit.m:1502:2: warning: #warning ABGR
blit.m:1536:2: warning: #warning B5G6R5
blit.m:1574:2: warning: #warning B5G5R5A1
Linking tool gpbs ...
/usr/lib/libc.so.4: WARNING!  setkey(3) not present in the system!
/usr/lib/libc.so.4: warning: this program uses gets(), which is unsafe.
/usr/lib/libc.so.4: warning: mktemp() possibly used unsafely; consider using mkstemp()
/usr/lib/libc.so.4: WARNING!  des_setkey(3) not present in the system!
/usr/lib/libc.so.4: WARNING!  encrypt(3) not present in the system!
/usr/lib/libc.so.4: warning: tmpnam() possibly used unsafely; consider using mkstemp() /usr/lib/libc.so.4: warning: this program uses f_prealloc(), which is not recommended.
/usr/lib/libc.so.4: WARNING!  des_cipher(3) not present in the system!
/usr/lib/libc.so.4: warning: tempnam() possibly used unsafely; consider using mkstemp()

I think that the link warnings are outside our control ... as far as I know we don't use any of the functions mentioned ... so I suspect they are being used by other libraries ... certainly, the only place I could find mktemp() in our source code is in NSData.m .... and it's only used there on operating systems where mkstemp() is not available!

So ...
1. I've altered code to avoid warnings (though that doesn't make it any more correct)
where it was fairly easy to do so

2. The protocol warnings are a bug in the compiler, and are fixed in some later
coimpiler version.

3. link bugs I didn't find in the gnustep code (and don't occur on my debian system) ... perhaps you could find out which librariees the functions are referenced in, and
notify the maintainers of those libraries?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]