public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: aj@suse.de
To: gcc-gnats@gcc.gnu.org
Subject: c/9482: math builtins are always visible
Date: Tue, 28 Jan 2003 16:06:00 -0000	[thread overview]
Message-ID: <20030128160315.324E8EE548@byrd.suse.de> (raw)


>Number:         9482
>Category:       c
>Synopsis:       math builtins are always visible
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 28 16:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        3.3 20030114 (prerelease)
>Organization:
SuSE Linux AG
>Environment:
System: Linux byrd 2.4.19 #1 Wed Nov 13 12:23:24 UTC 2002 x86_64 unknown
Architecture: x86_64

	
host: x86_64-unknown-linux-gnu
build: x86_64-unknown-linux-gnu
target: x86_64-unknown-linux-gnu
configured with: /cvs/gcc-3_3-branch/configure --prefix=/opt/gcc/3.3-devel --disable-nls --enable-threads=posix --enable-clocale=gnu --enable-__cxa_atexit --enable-shared --enable-languages=c,c++,f77,java,objc,ada,treelang --enable-checking=misc,tree,rtl,gc,rtlflag --with-system-zlib
>Description:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#if USE_EXTERN
extern log (char *);
#endif

int
main (void)
{
  log ("hi");

  return 0;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

According to ISO C99, log is only a reserved identifier if <math.h> is
included.  But <math.h> is not included in the example above and
therefore compilation should succeed.  But it fails as follows:

$ /opt/gcc/3.3-devel/bin/gcc -Wall -c log-test.c -O
log-test.c: In function `main':
log-test.c:9: warning: implicit declaration of function `log'
log-test.c:9: error: incompatible type for argument 1 of `log'

Use the extern declaration makes the program compile but the warnings
are still not ok:

$ /opt/gcc/3.3-devel/bin/gcc -Wall -c log-test.c -O -DUSE_EXTERN
log-test.c:3: warning: type defaults to `int' in declaration of `log'
log-test.c:3: warning: conflicting types for built-in function `log'


>How-To-Repeat:
	Compile the test program.

>Fix:
	None known besides renaming the program.
>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2003-01-28 16:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-28 16:06 aj [this message]
2003-01-28 16:36 Christian Ehrhardt
2003-01-28 16:56 Andreas Jaeger
2003-01-28 17:56 Joseph S. Myers
2003-01-28 18:06 Joseph S. Myers
2003-01-28 20:16 Christian Ehrhardt
2003-01-28 20:21 aj
2003-01-28 20:26 Andreas Jaeger

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=20030128160315.324E8EE548@byrd.suse.de \
    --to=aj@suse.de \
    --cc=gcc-gnats@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).