[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: warnings on gnustep
From: |
Adrian Robert |
Subject: |
Re: warnings on gnustep |
Date: |
Wed, 20 Aug 2008 22:50:46 -0400 |
On Aug 6, 2008, at 11:41 PM, Dan Nicolaescu wrote:
I managed to get access to a machine that has a gnustep
installation. I
get these warnings when compiling the ns*.m files.
The 'lrint' looks strange, on my Fedora systems lrint is in <math.h>
which is included. I haven't looked at why this happens.
Some brief googling suggests this has something to do with various C
standards and arguments like -std=c99. I don't understand this at
all, but if you look in that math.h are the lrint definitions
protected by any ifdefs? Also I wonder what effect that -D_BSD_SOURCE
has and where is that coming from?
But the signal ones are probably something to worry about.
Which ones are you talking about? (The word "signal" is not appearing
in the warnings below.)
BTW, I think that the includes need to be reordered, if you look in
all
the other files in emacs config.h is the first file included, that is
not the case in the ns*.m files.
Hmm, these other files also seem to include <config.h>, as if it's a
system include, rather than "config.h". I don't understand why. The
NS files include system includes first, then local ones, and
"config.h" is the first of these.
I'm going to comment on other stuff below individually.
gcc -c -D_BSD_SOURCE -Demacs -DHAVE_CONFIG_H -I. -I/home/jars/
emacs/src -D_BSD_SOURCE -D_REENTRANT -fPIC -fno-strict-aliasing -
g -O2 -Wno-pointer-sign -I/usr/include/GNUstep -fgnu-runtime -Wno-
import -fconstant-string-class=NSConstantString -
DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGSWARN
-DGSDIAGNOSE nsterm.m
nsterm.m: In function 'ns_update_end':
nsterm.m:658: warning: 'NSView' may not respond to '-
unlockFocusNeedsFlush:'
nsterm.m:658: warning: (Messages without a matching method signature
nsterm.m:658: warning: will be assumed to return 'id' and accept
nsterm.m:658: warning: '...' as arguments.)
Should be gone now (but someone on GNUstep please test).
nsterm.m: In function 'ns_color_to_lisp':
nsterm.m:1549: warning: incompatible implicit declaration of built-
in function 'lrint'
nsterm.m:1555: warning: incompatible implicit declaration of built-
in function 'lrint'
nsterm.m: In function 'ns_mouse_position':
nsterm.m:1765: warning: incompatible implicit declaration of built-
in function 'lrint'
nsterm.m: In function 'ns_draw_window_cursor':
nsterm.m:2375: warning: incompatible implicit declaration of built-
in function 'lrint'
Discussed above.
nsterm.m: In function 'ns_read_socket':
nsterm.m:3072: warning: 'NSApplication' may not respond to '-
openFile:'
I added a cast to fix this.
nsterm.m: In function '-[EmacsApp application:openFiles:]':
nsterm.m:4153: warning: 'EmacsApp' may not respond to '-
replyToOpenOrPrint:'
This whole delegate method is undeclared / unused in GNUstep. I put
the replyToOpenOrPrint call inside #ifndef GNUSTEP, although when it
eventually implements it this would need updating. Might be better to
just live w/the warning since it will never cause an error.
nsterm.m: In function '-[EmacsView changeFont:]':
nsterm.m:4332: warning: incompatible implicit declaration of built-
in function 'lrint'
nsterm.m: In function '-[EmacsView setMarkedText:selectedRange:]':
nsterm.m:4570: warning: pointer type mismatch in conditional
expression
Not sure what the problem is here.
nsterm.m: In function '-[EmacsView mouseDown:]':
nsterm.m:4764: warning: incompatible implicit declaration of built-
in function 'lrint'
nsterm.m: In function '-[EmacsView performDragOperation:]':
nsterm.m:5379: warning: incompatible implicit declaration of built-
in function 'lrint'
nsterm.m: In function 'ns_font_to_xlfd':
nsterm.m:6261: warning: incompatible implicit declaration of built-
in function 'lrint'
gcc -c -D_BSD_SOURCE -Demacs -DHAVE_CONFIG_H -I. -I/home/jars/
emacs/src -D_BSD_SOURCE -D_REENTRANT -fPIC -fno-strict-aliasing -
g -O2 -Wno-pointer-sign -I/usr/include/GNUstep -fgnu-runtime -Wno-
import -fconstant-string-class=NSConstantString -
DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGSWARN
-DGSDIAGNOSE nsfns.m
nsfns.m: In function 'Fns_read_file_name':
nsfns.m:1451: warning: pointer type mismatch in conditional expression
I added a cast to id?
nsfns.m: In function 'Fns_convert_utf8_nfd_to_nfc':
nsfns.m:2003: warning: no '-precomposedStringWithCanonicalMapping'
method found
Hmm. I changed to check for the impl and warn/return Qnil if not
present, but the compiler warning will still be there.
nsfns.m: In function 'Fxw_color_values':
nsfns.m:2249: warning: incompatible implicit declaration of built-in
function 'lrint'
gcc -c -D_BSD_SOURCE -Demacs -DHAVE_CONFIG_H -I. -I/home/jars/
emacs/src -D_BSD_SOURCE -D_REENTRANT -fPIC -fno-strict-aliasing -
g -O2 -Wno-pointer-sign -I/usr/include/GNUstep -fgnu-runtime -Wno-
import -fconstant-string-class=NSConstantString -
DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGSWARN
-DGSDIAGNOSE nsmenu.m
nsmenu.m: In function '-[EmacsMenu fillWithWidgetValue:]':
nsmenu.m:684: warning: passing argument 1 of 'setAction:' from
incompatible pointer type
setAction: takes a SEL. I thought nil was correct?
nsmenu.m: In function '-[EmacsMenu addSubmenuWithTitle:forFrame:]':
nsmenu.m:705: warning: passing argument 2 of
'addItemWithTitle:action:keyEquivalent:' from incompatible pointer
type
Ditto.
gcc -c -D_BSD_SOURCE -Demacs -DHAVE_CONFIG_H -I. -I/home/jars/
emacs/src -D_BSD_SOURCE -D_REENTRANT -fPIC -fno-strict-aliasing -
g -O2 -Wno-pointer-sign -I/usr/include/GNUstep -fgnu-runtime -Wno-
import -fconstant-string-class=NSConstantString -
DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGSWARN
-DGSDIAGNOSE nsselect.m
gcc -c -D_BSD_SOURCE -Demacs -DHAVE_CONFIG_H -I. -I/home/jars/
emacs/src -D_BSD_SOURCE -D_REENTRANT -fPIC -fno-strict-aliasing -
g -O2 -Wno-pointer-sign -I/usr/include/GNUstep -fgnu-runtime -Wno-
import -fconstant-string-class=NSConstantString -
DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGSWARN
-DGSDIAGNOSE nsimage.m
nsimage.m: In function '-[EmacsImage getPixelAtX:Y:]':
nsimage.m:417: warning: 'NSBitmapImageRep' may not respond to '-
colorAtX:y:'
nsimage.m:417: warning: (Messages without a matching method signature
nsimage.m:417: warning: will be assumed to return 'id' and accept
nsimage.m:417: warning: '...' as arguments.)
nsimage.m: In function '-[EmacsImage
setPixelAtX:Y:toRed:green:blue:alpha:]':
nsimage.m:447: warning: 'NSBitmapImageRep' may not respond to '-
setColor:atX:y:'
nsimage.m: In function '-[EmacsImage setAlphaAtX:Y:to:]':
nsimage.m:464: warning: 'NSBitmapImageRep' may not respond to '-
colorAtX:y:'
nsimage.m:466: warning: 'NSBitmapImageRep' may not respond to '-
setColor:atX:y:'
I don't understand these. Both methods are declared for
NSBitmapImageRep in GNUstep:
http://www.gnustep.org/resources/documentation/Developer/Gui/Reference/NSBitmapImageRep.html#class$NSBitmapImageRep
gcc -c -D_BSD_SOURCE -Demacs -DHAVE_CONFIG_H -I. -I/home/jars/
emacs/src -D_BSD_SOURCE -D_REENTRANT -fPIC -fno-strict-aliasing -
g -O2 -Wno-pointer-sign -I/usr/include/GNUstep -fgnu-runtime -Wno-
import -fconstant-string-class=NSConstantString -
DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGSWARN
-DGSDIAGNOSE nsfont.m
nsfont.m: In function 'nsfont_open':
nsfont.m:682: warning: incompatible implicit declaration of built-in
function 'lrint'
nsfont.m: In function 'nsfont_draw':
nsfont.m:925: warning: comparison is always true due to limited
range of data type
cbuf and c should probably be made unsigned char, but only someone who
can test should try this.
nsfont.m:994: warning: pointer type mismatch in conditional expression
Unsure why, all should be NSColor *.
nsfont.m:1019: warning: comparison between pointer and integer
nsfont.m:1025: warning: comparison between pointer and integer
I've fixed these.
nsfont.m: In function 'ns_glyph_metrics':
nsfont.m:1384: warning: incompatible implicit declaration of built-
in function 'lrint'
nsfont.m:1389: warning: incompatible implicit declaration of built-
in function 'round'
- Re: warnings on gnustep,
Adrian Robert <=