[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problem with inline functions in gsweb and clang
From: |
Sebastian Reitenbach |
Subject: |
Re: problem with inline functions in gsweb and clang |
Date: |
Mon, 27 May 2013 23:05:14 +0200 |
User-agent: |
SOGoMail 2.0.5a |
On Monday, May 27, 2013 19:18 CEST, Ivan Vučica <ivucica@gmail.com> wrote:
> Somewhat off topic: I really like the following error; it's extremely
> professional and mature. Where is it coming from?
>
> /usr/local/lib/libgcrypt.so.18.0: warning: stpcpy() is dangerous GNU crap;
> don't use it
>
> I'm asking because it could be made more colorful; this is simply
> insufficiently graphic. Where can we send a patch?
What's wrong with it?
It comes from the OpenBSD linker, and there are even more, for example:
clang-3: warning: argument unused during compilation: '-shared-libgcc'
/usr/local/lib/libgnustep-base.so.6.0: warning: strcpy() is almost always
misused, please use strlcpy()
/usr/local/lib/libgnustep-base.so.6.0: warning: sprintf() is often misused,
please use snprintf()
/usr/local/lib/libicui18n.so.6.0: warning: strcat() is almost always misused,
please use strlcat()
/usr/local/lib/libungif.so.5.4: warning: vsprintf() is often misused, please
use vsnprintf()
/usr/local/lib/libgcrypt.so.18.0: warning: stpcpy() is dangerous GNU crap;
don't use it
the linker emits those warnings, when it finds symbols for those functions in a
program or library.
the ones in libgnustep-base, can be get rid of, just follow the advice give.
Other softwares, have to be fixed on their own.
cheers,
Sebastian
>
> Regards,
>
> Ivan Vučica
> via phone
>
> On 27. 5. 2013., at 13:56, "Sebastian Reitenbach"
> <sebastia@l00-bugdead-prods.de> wrote:
>
> > Hi,
> >
> > in gsweb, when trying to compile the examples of GSWeb with clang 3.2, I
> > get the following error:
> >
> > $ CC="clang -v" gmake
> > This is gnustep-make 2.6.4. Type 'gmake print-gnustep-make-help' for help.>
> > Running in gnustep-make version 2 strict mode.
> > Making all for gswapp WebBookStore1...
> > Linking gswapp WebBookStore1 ...
> > clang version 3.2 (tags/RELEASE_32/final)
> > Target: amd64-unknown-openbsd5.3
> > Thread model: posix
> > "/usr/bin/ld" -nopie -e __start --eh-frame-hdr -Bdynamic -dynamic-linker
> > /usr/libexec/ld.so -o WebBookStore1.gswa/./WebBookStore1 /usr/lib/crt0.o
> > /usr/lib/crtbegin.o -L/usr/lib/gcc-lib/amd64-unknown-openbsd5.3/4.2.1
> > -L/usr/local/lib -L/home/sebastia/GNUstep/Library/Libraries
> > -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -E
> > ./obj/WebBookStore1.obj/Application.m.o ./obj/WebBookStore1.obj/Session.m.o
> > ./obj/WebBookStore1.obj/DirectAction.m.o ./obj/WebBookStore1.obj/Main.m.o
> > ./obj/WebBookStore1.obj/WebBookStore1_main.m.o -lWebObjects -lWOExtensions
> > -lGSWDatabase -lEOAccess -lEOControl -lpng -lz -lxml2 -lz -liconv -lm
> > -lgnustep-base -lobjc2 -lm -lgcc -lpthread -lc -lgcc /usr/lib/crtend.o
> > /usr/local/lib/libWebObjects.so.0.0: warning: vsprintf() is often misused,
> > please use vsnprintf()
> > /usr/local/lib/libWebObjects.so.0.0: warning: strcpy() is almost always
> > misused, please use strlcpy()
> > /usr/local/lib/libWebObjects.so.0.0: warning: strcat() is almost always
> > misused, please use strlcat()
> > /usr/local/lib/libWebObjects.so.0.0: warning: sprintf() is often misused,
> > please use snprintf()
> > /usr/local/lib/libgcrypt.so.18.0: warning: stpcpy() is dangerous GNU crap;
> > don't use it
> > /usr/local/lib/libWebObjects.so.0.0: undefined reference to `parseNumber'
> > /usr/local/lib/libWebObjects.so.0.0: undefined reference to `parseArray'
> > /usr/local/lib/libWebObjects.so.0.0: undefined reference to
> > `skipBlanksAndComments'
> > /usr/local/lib/libWebObjects.so.0.0: undefined reference to `parsePragma'
> > /usr/local/lib/libWebObjects.so.0.0: undefined reference to
> > `areUnicharEquals'
> > /usr/local/lib/libWebObjects.so.0.0: undefined reference to
> > `parseDeclaration'
> > /usr/local/lib/libWebObjects.so.0.0: undefined reference to `skipComment'
> > /usr/local/lib/libWebObjects.so.0.0: undefined reference to `skipBlanks'
> > /usr/local/lib/libWebObjects.so.0.0: undefined reference to
> > `parseIdentifier'
> > /usr/local/lib/libWebObjects.so.0.0: undefined reference to `parseHexNumber'
> > /usr/local/lib/libWebObjects.so.0.0: undefined reference to
> > `parseQuotedString'
> > /usr/local/lib/libWebObjects.so.0.0: undefined reference to
> > `parseDictionaryWithValuesAsAssociations'
> > /usr/local/lib/libWebObjects.so.0.0: undefined reference to
> > `tryParseBoolean'
> > /usr/local/lib/libWebObjects.so.0.0: undefined reference to `parseKeyPath'>
> > /usr/local/lib/libWebObjects.so.0.0: undefined reference to
> > `parseValueAsAssociation'
> > /usr/local/lib/libWebObjects.so.0.0: undefined reference to `parseHexData'>
> > clang-3: error: linker command failed with exit code 1 (use -v to see
> > invocation)
> > gmake[2]: *** [WebBookStore1.gswa/./WebBookStore1] Error 1
> > gmake[1]: *** [WebBookStore1.all.gswapp.variables] Error 2
> > gmake: *** [internal-all] Error 2
> >
> > most of the undefined sybols come from the GSWDeclarationParser.m, which is
> > compiled this way:
> > clang GSWDeclarationParser.m -c \
> > -MMD -MP -I/usr/local/include/gnustep -DGSWEB_WONAMES -DGNUSTEP
> > -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_R
> > UNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -fno-strict-aliasing -fexceptions
> > -fobjc-exceptions -D_NATIVE_OBJC_EXCEPTIONS -fobjc-non
> > fragile-abi -D_NONFRAGILE_ABI -pthread -fPIC -DDEBUG
> > -fno-omit-frame-pointer -Wall -DGSWARN -DGSDIAGNOSE -Wno-import -O2 -
> > pipe -g -O0 -fgnu-runtime -Werror-implicit-function-declaration -Werror
> > -fconstant-string-class=NSConstantString -I./. -I/
> > usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include/libxml2
> > -I/usr/local/include -I/usr/local/include/libp
> > ng -I./derived_src -I. -I/usr/local/include
> > -I/gnustep-web-1.3.0_writes_to_HOME/GNUstep/Library/Headers
> > -I/usr/local/inclu
> > de \
> > -o obj/WebObjects/WebObjects.obj/GSWDeclarationParser.m.o
> >
> > and then linked into libWebObjects this way:
> > cc -shared -Wl,-E -L/usr/local/lib -pthread -fexceptions
> > -fobjc-nonfragile-abi -o ./WebObjects.framework/Versions/0.
> > 0/./libWebObjects.so.0.0
> > obj/WebObjects/WebObjects.obj/NSFramework_WebObjects.o
> > obj/WebObjects/WebObjects.obj/GSWDebug.m.o
> > obj/WebObjects/WebObjects.obj/GSWConstants.m.o
> > obj/WebObjects/WebObjects.obj/GSWTemporaryElement.m.o obj/WebObjects/WebOb
> > jects.obj/GSWBaseParser.m.o
> > obj/WebObjects/WebObjects.obj/GSWHTMLRawParser.m.o
> > obj/WebObjects/WebObjects.obj/GSWHTTPIO.m.o
> > obj/WebObjects/WebObjects.obj/GSWDeclaration.m.o
> > obj/WebObjects/WebObjects.obj/GSWDeclarationParser.m.o
> > ....
> >
> > The functions are declared like this:
> >
> > inline NSDictionary*
> > parseDictionaryWithValuesAsAssociations(GSWDeclarationParser* parser,
> > BOOL
> > valuesAsAssociations)
> > {
> > return
> > ((*parser->_selfIMPs._parseDictionaryWithValuesAsAssociationsIMP)(parser,parseDictionaryWithValuesAsAssociationsSEL,valuesAsAssociations));
> > };
> >
> > When I remove the inline before that, then libWebObjects can resolve the
> > symbols. Since its compiled with -O0, I think the compiler should not
> > inline those functions?
> >
> > I tried that on OpenBSD, David Wetzel seemed to use gcc on NetBSD, where
> > the problem did not occured to him.
> > Is it sane to just remove the inline statement, or is there something more
> > clever I can do about it?
> >
> > cheers,
> > Sebastian
> >
> >
> >
> >
> > _______________________________________________
> > Discuss-gnustep mailing list
> > Discuss-gnustep@gnu.org
> > https://lists.gnu.org/mailman/listinfo/discuss-gnustep