This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: gcc "bug"
- From: Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>
- To: Jeffrey Hammel <jhammel at EECS dot Berkeley dot EDU>
- Cc: gcc-bugs at gcc dot gnu dot org, alanwu at langmuir dot eecs dot berkeley dot edu
- Date: 16 Feb 2004 22:53:04 +0100
- Subject: Re: gcc "bug"
- References: <Pine.SOL.4.44.0402161329500.6719-100000@argus.EECS.Berkeley.EDU>
Jeffrey Hammel <jhammel@EECS.Berkeley.EDU> writes:
> A possible "bug" in gcc (or "feature"?): when linking to libraries
> without header files, gcc will give no error or warning BUT the library
> calls will not give the correct results. A simple program:
>
> gcc-bug.c:
> #include<stdio.h>
> main() { printf("\n%g\n", log(2.71)); }
You need -Wimplicit (or -Wall) to get a warning. This is by design,
since many old sources use implicit declarations. For new source, you
should always use -Wall.
--
Falk