This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: A bug (?) with inline functions at O0: undefined reference
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Ilya Verbin <iverbin at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 6 Mar 2015 17:21:19 +0100 (CET)
- Subject: Re: A bug (?) with inline functions at O0: undefined reference
- Authentication-results: sourceware.org; auth=none
- References: <20150306161248 dot GC26588 at msticlxl57 dot ims dot intel dot com>
- Reply-to: gcc at gcc dot gnu dot org
On Fri, 6 Mar 2015, Ilya Verbin wrote:
I've discovered a strange behaviour on trunk gcc, here is the reproducer:
inline int foo ()
{
return 0;
}
int main ()
{
return foo ();
}
$ gcc main.c
/tmp/ccD1LeXo.o: In function `main':
main.c:(.text+0xa): undefined reference to `foo'
collect2: error: ld returned 1 exit status
Is this a bug? If yes, is it known?
GCC 4.8.3 works fine though.
Not a bug, that's what inline means in C99 and later.
--
Marc Glisse