[LLVMdev] Linking strncpy

Eric Zimmerman ezimmerm at uiuc.edu
Thu Apr 15 20:03:01 PDT 2004


On Thu, Apr 15, 2004 at 08:32:44AM -0500, John Criswell wrote:
> >
> >I'm fine with using JIT, but I'm trying to understand this problem:
> >1. My LLVM program does not produce correct results
> >2. Using llvm-dis, I disassemble the bytecode to C
> >3. I recompile using GCC and the program _works correctly_.
> >
> >The only odd thing is when I recompile with GCC, I see these messages:
> >
> >pal3.c:195: warning: conflicting types for built-in function `strcmp'
> >pal3.c:200: warning: conflicting types for built-in function `memcpy'
> >pal3.c:202: warning: conflicting types for built-in function `strncpy'
> >
> >The lines referenced are:
> >int strcmp(signed char *, signed char *);
> >signed char *memcpy(signed char *, signed char *, unsigned );
> >signed char *strncpy(signed char *, signed char *, unsigned );
> >
> >Do you have any insight into what's happening?  Thanks,
> 
> These warnings seem to happen and, as far as I can tell, can be safely 
> ignored.
> 
> If you're on x86, it's possible that your code works incorrectly due to 
> bugs in our code generator that have been fixed since I created the LLVM 
> source tarball for your class.  I know at least one codegen bug has been 
> found since I made the tarball.
> 
> If you could post the snippet of LLVM assembly code that is miscompiled, 
> that will help us figure out if LLVM was/is miscompiling your program. 
> Also, you can check the following URL for X86 Backend bugs to see if 
> your code could be triggering the following bugs:
> 
> http://llvm.cs.uiuc.edu/bugs/buglist.cgi?short_desc_type=allwordssubstr&short_desc=&component=X86+Backend&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=&bug_status=RESOLVED&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&namedcmd=All&newqueryname=&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0=
> 
> Regards,
> 
> -- John T.
> 


 Thanks for the explanation of the GCC warnings.  The source of my
problem was apparently on my end since I haven't been able to
reproduce the bug since yesterday.  Again, thanks to all for your
help.

-Eric



More information about the llvm-dev mailing list