This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/9862: spurious warnings with -W -O3 using gcc-3.2.2
- From: Daniel Villeneuve <danielv at ad-opt dot com>
- To: gcc-gnats at gcc dot gnu dot org
- Date: Wed, 26 Feb 2003 08:46:34 -0500 (EST)
- Subject: c/9862: spurious warnings with -W -O3 using gcc-3.2.2
>Number: 9862
>Category: c
>Synopsis: spurious warnings with -W -O3 using gcc-3.2.2
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Feb 26 13:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Daniel Villeneuve
>Release: 3.2.2
>Organization:
Ad Opt Technologies Inc.
>Environment:
System: SunOS neuchatel 5.8 Generic_108528-17 sun4u sparc SUNW,Sun-Blade-100
Architecture: sun4
host: sparc-sun-solaris2.7
build: sparc-sun-solaris2.7
target: sparc-sun-solaris2.7
configured with: ./configure --prefix=/misc/ultra-sun-solaris2/gcc-3.2.2 --enable-threads=posix --disable-shared --disable-multilib
>Description:
In the file <file.c> given below, the <trigger> function might return
with or without a value.
If compiling with -ansi -Wall -W -O3, the compiler warns about this,
but also warns about the function <f> having the same problem,
which is not the case.
<file.c>
extern int i;
extern int f(void);
extern int trigger(void);
int f(void)
{
if( i ) return 0;
else return 1;
}
int trigger(void)
{
if( i ) return;
else return 1;
}
</file.c>
>How-To-Repeat:
gcc -ansi -Wall -W -O3 -c file.c
>Fix:
NOTE: This e-mail and any file attached therewith is intended only for the named recipient(s) above and contains information that is confidential and may be legally privileged and/or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this e-mail message.
NOTE: Ce courriel ainsi que tout fichier d'accompagnement est destiné à l'usage exclusif du destinataire(s) mentionné(s) ci-dessus et peut contenir de l'information confidentielle, privilegiée et/ou dispensée de divulgation aux termes des lois applicables. Si vous avez reçu ce message par erreur, ou s'il ne vous est pas destiné, veuillez le mentionner immédiatement à l'expéditeur et effacer ce courriel.
>Release-Note:
>Audit-Trail:
>Unformatted: