On 04/19/10 18:04, Mike McCarty wrote: > James Richard Tyrer wrote: >> Is there something wrong with this code: >> >> NetworkManager-0.8.build/src/NetworkManagerPolicy.c: >> >> #include<ctype.h> >> >> if (isblank (*p) || (*p == '\0')) { >> >> ?? GCC-4.3.4 doesn't like it: >> >> NetworkManagerPolicy.c:272: error: implicit declaration of function >> 'isblank' > > Yep. The Standard C provides somehthing which is similar to what is > meant, but the name is "isspace(.)". "isblank(.)" is a GNU > extension. > And I am compiling against GLibC, so it should be OK.
Could this be the wrong error message? > Are you compiling with strict ANSI compliance? The command when it doesn't work is: /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../marshallers -I../src/named-manager -I../src/vpn-manager -I../src/dhcp-manager -I../src/ip6-manager -I../src/supplicant-manager -I../src/dnsmasq-manager -I../src/modem-manager -I../src/bluez-manager -I../src/system-settings -I../libnm-util -I../libnm-glib -I../callouts -pthread -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -pthread -I/usr/include/gudev-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DG_DISABLE_DEPRECATED -DBINDIR=\"/usr/bin\" -DSBINDIR=\"/usr/sbin\" -DLIBEXECDIR=\"/usr/lib/network-manager\" -DDATADIR=\"/usr/share\" -DSYSCONFDIR=\"/etc\" -DLOCALSTATEDIR=\"/var\" -DNM_RUN_DIR=\"/var/run/NetworkManager\" -DNMLOCALEDIR=\"/usr/share/locale\" -DARP_DEBUG -I/usr/gnome-2/include -I/usr/include/mysql -I/usr/lib/xulrunner-1.9.2.3 -Wall -Werror -std=gnu89 -march=athlon -mtune=athlon -O2 -m128bit-long-double -Wshadow -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare -fno-strict-aliasing -MT NetworkManager-NetworkManagerPolicy.o -MD -MP -MF .deps/NetworkManager-NetworkManagerPolicy.Tpo -c -o NetworkManager-NetworkManagerPolicy.o `test -f 'NetworkManagerPolicy.c' || echo './'`NetworkManagerPolicy.c Doesn't look that way, > > isspace(.) looks for space, tab, vertical tab, newline, return, > and formfeed. > isblank(.) looks only for space and tab. > >> Any suggestions? >> >> Note that it does compile OK if I add the: "configure" paramater: >> >> --disable-more-warnings > > Uh, it doesn't compile any differently, you just don't see the > warning. That function has no prototype in scope. The GNU: "ctype.h" header defines it as something else, apparently dependent on whether or not various things are defined, so there should be the function somewhere, but it is possible that the C headers are missing the prototype. That is a warning, not an error, so it should compile correctly. So, I added: "-Wno-error=implicit-function-declaration" to the above command and it compiles correctly. Using: "-Wno-error=missing-prototypes" doesn't fix it, so I doubt that it is a missing prototype. What is implicit about the definition unless there is a problem with the header? OTOH, using: "isspace" instead of: "isblank" in the code fixes the problem cures the problem. -- James Tyrer Linux (mostly) From Scratch -- http://linuxfromscratch.org/mailman/listinfo/blfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page