public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: t-rexky <gvvn1200@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: Endless "declared 'static' but never defined" warnings with stage 2 & 3 compilers
Date: Mon, 11 Jun 2012 19:10:00 -0000	[thread overview]
Message-ID: <5847F3E7-3BAE-4930-9F28-2EB3CD8B6591@gmail.com> (raw)

Hello,

(please note that this is a modified repost from the gcc-help list - I was told that the gcc list is a better place for my questions)

I have been trying to port a reasonably recent version of gcc to a m68k NeXT running NEXTSTEP 3.3.  After many struggles and lots of help from the m68k debian ports team I was finally able to complete the bootstrap process on gcc-4.2.4.  The stage 2 and stage 3 compiler appear to be working reasonably well and producing good code, but they generate an endless list of warnings that do not occur with the stage 1 compiler.  Here is some sample code and the warnings with various gcc options:

> #include <math.h>
> #include <stdio.h>
> 
> int main() {
>   printf("%lf\n", acos(0.5));
>   return 0;
> }

nextstep[Tests]$xgcc acos_test.c -o acos_test
<built-in>:0: warning: '__builtin_acos' used but never defined
/NextDeveloper/Headers/ansi/math.h:55: warning: 'acos' used but never defined
<built-in>:0: warning: '__builtin_printf' used but never defined
/NextDeveloper/Headers/ansi/stdio.h:123: warning: 'printf' used but never defined

nextstep[Tests]$xgcc acos_test.c -o acos_test -O 

> #include <math.h>
> #include <stdio.h>
> 
> int main() {
>   printf("%lf\n",  __builtin_acos(0.5));
>   return 0;
> }

nextstep[Tests]$xgcc builtin_acos_test.c -o builtin_acos_test
<built-in>:0: warning: '__builtin_acos' used but never defined
/NextDeveloper/Headers/ansi/math.h:55: warning: 'acos' used but never defined
<built-in>:0: warning: '__builtin_printf' used but never defined
/NextDeveloper/Headers/ansi/stdio.h:123: warning: 'printf' used but never defined

nextstep[Tests]$xgcc builtin_acos_test.c -o builtin_acos_test -O   

nextstep[Tests]$xgcc builtin_acos_test.c -o builtin_acos_test -Wall
<built-in>:0: warning: '__builtin_acos' used but never defined
/NextDeveloper/Headers/ansi/math.h:55: warning: 'acos' used but never defined
<built-in>:0: warning: '__builtin_acosf' declared 'static' but never defined
<built-in>:0: warning: 'acosf' declared 'static' but never defined
<built-in>:0: warning: '__builtin_acosh' declared 'static' but never defined
/NextDeveloper/Headers/ansi/math.h:24: warning: 'acosh' declared 'static' but never defined
<built-in>:0: warning: '__builtin_acoshf' declared 'static' but never defined
<built-in>:0: warning: 'acoshf' declared 'static' but never defined
<built-in>:0: warning: '__builtin_acoshl' declared 'static' but never defined
<built-in>:0: warning: 'acoshl' declared 'static' but never defined
<built-in>:0: warning: '__builtin_acosl' declared 'static' but never defined
<built-in>:0: warning: 'acosl' declared 'static' but never defined
<built-in>:0: warning: '__builtin_asin' declared 'static' but never defined
/NextDeveloper/Headers/ansi/math.h:56: warning: 'asin' declared 'static' but never defined
<built-in>:0: warning: '__builtin_asinf' declared 'static' but never defined
<built-in>:0: warning: 'asinf' declared 'static' but never defined
<built-in>:0: warning: '__builtin_asinh' declared 'static' but never defined
/NextDeveloper/Headers/ansi/math.h:23: warning: 'asinh' declared 'static' but never defined
^C (I aborted here since xgcc spits out an endless list of similar warnings, but the resultant executable works)

nextstep[Tests]$xgcc builtin_acos_test.c -o builtin_acos_test -O -Wall
<built-in>:0: warning: '__builtin_acos' declared 'static' but never defined
/NextDeveloper/Headers/ansi/math.h:55: warning: 'acos' declared 'static' but never defined
<built-in>:0: warning: '__builtin_acosf' declared 'static' but never defined
<built-in>:0: warning: 'acosf' declared 'static' but never defined
<built-in>:0: warning: '__builtin_acosh' declared 'static' but never defined
/NextDeveloper/Headers/ansi/math.h:24: warning: 'acosh' declared 'static' but never defined
<built-in>:0: warning: '__builtin_acoshf' declared 'static' but never defined
<built-in>:0: warning: 'acoshf' declared 'static' but never defined
<built-in>:0: warning: '__builtin_acoshl' declared 'static' but never defined
<built-in>:0: warning: 'acoshl' declared 'static' but never defined
<built-in>:0: warning: '__builtin_acosl' declared 'static' but never defined
<built-in>:0: warning: 'acosl' declared 'static' but never defined
<built-in>:0: warning: '__builtin_asin' declared 'static' but never defined
/NextDeveloper/Headers/ansi/math.h:56: warning: 'asin' declared 'static' but never defined
<built-in>:0: warning: '__builtin_asinf' declared 'static' but never defined
<built-in>:0: warning: 'asinf' declared 'static' but never defined
<built-in>:0: warning: '__builtin_asinh' declared 'static' but never defined
/NextDeveloper/Headers/ansi/math.h:23: warning: 'asinh' declared 'static' but never defined
^C (I aborted here since xgcc spits out an endless list of similar warnings, but the resultant executable works)

Similar warnings occur on every source file for built-in function declarations and functions declared in the included header files.   I am completely perplexed that the stage1 compiler is working fine with no warning, yet stage2 and stage3 generate the warnings.  The target configuration for all three stages is obviously identical and the build options are almost identical.  And all three stages generate executables that appear to work just fine.  I am obviously missing something in the target configuration but after reviewing the GCC Internals document I could not find anything obvious.

I am struggling to identify the root cause of this issue and would very much appreciate any assistance, or even pointers on where to start looking.  Tinkering with software is only a hobby for me and my knowledge runs out pretty rapidly...

t-rexky

                 reply	other threads:[~2012-06-11 19:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5847F3E7-3BAE-4930-9F28-2EB3CD8B6591@gmail.com \
    --to=gvvn1200@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).