🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #6108

gcc not reporting error

#6108
From: Fred J. Tydeman
Date: Sun, 01 Dec 1996 00:00
62 lines
2587 bytes
The following program should get errors reported by gcc.

/* Program: gccemx01.c from tydeman@tybor.com */
/* Problem:  Invalid code is not being caught */

#include <math.h>	/* fabs(), sqrt(), sin(), cos() */

int fabs = 0;		/* these appear to be special builtin identifiers */
int sqrt = 1;
int sin = 2;
int cos = 3;

#if 0			/* make this a 1 and errors happen (as expected) */
int tan = 4;
#endif

int main( void ){
  return fabs + sqrt + sin + cos < 0;
}

My system is an Intel 80486DX running OS/2 Warp and I am using gcc 2.5.7
with emx 0.8h as found on the Ready to Run Hobbes OS/2 CD-ROM of Nov 1994.

I submitted this sample program to the emx author and he ran it on
gcc 2.7.2.1 and he said that there is no error reported there.

This is a Standard C conformance issue and not an impact on production
code, so this can be treated as a low priority item.

I compile with the following options:

 CCFLAGS = "-ansi",
        "-pedantic-errors",
        "-W",
        "-Wall",
        "-Wtraditional",
        "-Wshadow",
        "-Wpointer-arith",
        "-Wcast-qual",
        "-Wcast-align",
        "-Wstrict-prototypes",
        "-Wmissing-prototypes",
        "-Wredundant-decls",
        "-Wno-unused",
        "-mieee-fp",
        "-fno-fast-math",
        "-ffloat-store",
        "-Wconversion"

---
Fred J. Tydeman    +49 (7031) 288-964  Tydeman Consulting
Meisenweg 20       tydeman@tybor.com   Programming, testing, C/C++ training
D-71032 Boeblingen                     Voting member of X3J11 (ANSI "C")
Germany            Sample FPCE tests:  ftp://ftp.netcom.com/pub/ty/tydeman


---
Fred J. Tydeman    +49 (7031) 288-964  Tydeman Consulting
Meisenweg 20       tydeman@tybor.com   Programming, testing, C/C++ training
D-71032 Boeblingen                     Voting member of X3J11 (ANSI "C")
Germany            Sample FPCE tests:  ftp://ftp.netcom.com/pub/ty/tydeman
Technical Details
Message-ID: <m0vUAu2-000K0lC@hq.seicom.de>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113d02,60600ed081103dc9,start
X-Google-Attributes: gid113d02,public
From: "Fred J. Tydeman" <tydeman@tybor.com>
Subject: gcc not reporting error
Date: 1996/12/01
Message-ID: <m0vUAu2-000K0lC@hq.seicom.de>
X-Deja-AN: 201699618
sender: bug-gcc-request@prep.ai.mit.edu
priority: Normal
content-type: text/plain; charset="iso-8859-1"
x-gateway: relay2.UU.NET from bug-gcc to gnu.gcc.bug; Sun, 1 Dec 1996 07:43:46 EST
mime-version: 1.0
reply-to: "Fred J. Tydeman" <tydeman@tybor.com>
newsgroups: gnu.gcc.bug
x-mailer: Fred J. Tydeman's Registered PMMail 1.53 For OS/2