public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* This should at least give a warning even if it is legal C
@ 2004-02-01 19:35 Jason Wilson
  2004-02-01 19:39 ` Andrew Pinski
  0 siblings, 1 reply; 2+ messages in thread
From: Jason Wilson @ 2004-02-01 19:35 UTC (permalink / raw)
  To: gcc-bugs

[-- Attachment #1: Type: text/plain, Size: 196 bytes --]

I'm not sure if this program is legal C or not but it is certainly a 
bad program that could be caught by the compiler.  Compiling without 
optimization leads to a bus error as one might expect.


[-- Attachment #2: bad.c --]
[-- Type: text/plain, Size: 130 bytes --]


struct foobar
{
  int a;
  struct foobar *b;
};

int main (int argc, char **argv)
{
  struct foobar *bar = bar->b;
  return 0;
}

[-- Attachment #3: Type: text/plain, Size: 173 bytes --]



[Jason-Wilsons-G4:~] jason% gcc -v
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1495)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-02-01 19:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-01 19:35 This should at least give a warning even if it is legal C Jason Wilson
2004-02-01 19:39 ` Andrew Pinski

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).