public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* enquire build fail...
@ 1997-08-23 14:31 Peter Seebach
  1997-08-23 17:08 ` explicitly initializing automatics with specific (garbage) values Jim Meyering
  1997-08-23 17:08 ` egcs-ss-970821 -- bad comment Joel Sherrill
  0 siblings, 2 replies; 6+ messages in thread
From: Peter Seebach @ 1997-08-23 14:31 UTC (permalink / raw)
  To: egcs

Here's '/var/tmp/ccXXX.s':

---
        .file   "enquire.c"
/ GNU C version egcs-2.90.01 970821 (gcc2-970802 experimental) (i386-pc-bsdi3.0)
 compiled by GNU C version 1.42.
/ options passed:  -g -O0
/ options enabled:  -fpeephole -ffunction-cse -fkeep-static-consts
/ -freg-struct-return -fexceptions -fsjlj-exceptions -fcommon -fverbose-asm
/ -fgnu-linker -fargument-alias -m80387 -mhard-float -mno-soft-float
/ -mieee-fp -mfp-ret-in-387 -mschedule-prologue -mcpu=i386 -march=pentium

gcc2_compiled.:
___gnu_compiled_c:
---

unsurprisingly, this won't build, because of the '/ ...' stuff, which is
apparently not being ignored by the assembler, which I suppose was the
intent.

-s

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

* egcs-ss-970821 -- bad comment
  1997-08-23 14:31 enquire build fail Peter Seebach
  1997-08-23 17:08 ` explicitly initializing automatics with specific (garbage) values Jim Meyering
@ 1997-08-23 17:08 ` Joel Sherrill
  1 sibling, 0 replies; 6+ messages in thread
From: Joel Sherrill @ 1997-08-23 17:08 UTC (permalink / raw)
  To: egcs

The message is:

../../src/gcc/config/m68k/m68kemb.h:50: warning: `/*' within comment

The problem is at line 46 where a comment is not terminated.

--joel

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

* explicitly initializing automatics with specific (garbage) values
  1997-08-23 14:31 enquire build fail Peter Seebach
@ 1997-08-23 17:08 ` Jim Meyering
  1997-08-23 17:08 ` egcs-ss-970821 -- bad comment Joel Sherrill
  1 sibling, 0 replies; 6+ messages in thread
From: Jim Meyering @ 1997-08-23 17:08 UTC (permalink / raw)
  To: egcs

I vaguely recall someone suggesting adding an option to make gcc
initialize automatic variables to some (maybe-specified) bit pattern.

I recall making good use of an option like this back when I
worked with crusty old FORTRAN compilers.  I think it would be
useful for C, too.

Does anyone have patches to do that?

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

* Re: explicitly initializing automatics with specific (garbage) values
@ 1997-08-24  3:43 Jim Meyering
  1997-08-24  3:43 ` Richard Henderson
  0 siblings, 1 reply; 6+ messages in thread
From: Jim Meyering @ 1997-08-24  3:43 UTC (permalink / raw)
  To: egcs

Andi Kleen <ak@muc.de> writes:
| Jim Meyering <meyering@eng.ascend.com> writes:
|
| > I vaguely recall someone suggesting adding an option to make gcc
| > initialize automatic variables to some (maybe-specified) bit pattern.
| >
| > I recall making good use of an option like this back when I
| > worked with crusty old FORTRAN compilers.  I think it would be
| > useful for C, too.
| >
| > Does anyone have patches to do that?
|
| Isn't -Wuninitialized enough for this?

Sometimes it is.
Here's one case where it doesn't help, but where that sort of option would.
In the following, x is used uninitialized, but gcc doesn't detect it.

  #include <stdlib.h>

  static void
  foo (int *x)
  {
    if (*x)
      *x = 1;
  }

  int
  main ()
  {
    int x;
    foo (&x);
    exit (x);
  }

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

* Re: explicitly initializing automatics with specific (garbage) values
  1997-08-24  3:43 Jim Meyering
@ 1997-08-24  3:43 ` Richard Henderson
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Henderson @ 1997-08-24  3:43 UTC (permalink / raw)
  To: egcs

> > I vaguely recall someone suggesting adding an option to make gcc
> > initialize automatic variables to some (maybe-specified) bit pattern.
> 
> Isn't -Wuninitialized enough for this?

-Wuninitialized isn't smart enough.  And initializing to a bit
pattern both allows quick diagnosis in the debugger plus, in the
case of pointers, makes sure that the program will die at runtime.


r~

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

* Re: explicitly initializing automatics with specific (garbage) values
  1997-08-24  3:43 egcs has some bad optimization bug H.J. Lu
@ 1997-08-24  3:43 ` Andi Kleen
  0 siblings, 0 replies; 6+ messages in thread
From: Andi Kleen @ 1997-08-24  3:43 UTC (permalink / raw)
  To: egcs

Jim Meyering <meyering@eng.ascend.com> writes:

> I vaguely recall someone suggesting adding an option to make gcc
> initialize automatic variables to some (maybe-specified) bit pattern.
> 
> I recall making good use of an option like this back when I
> worked with crusty old FORTRAN compilers.  I think it would be
> useful for C, too.
> 
> Does anyone have patches to do that?

Isn't -Wuninitialized enough for this?

-Andi

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

end of thread, other threads:[~1997-08-24  3:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-08-23 14:31 enquire build fail Peter Seebach
1997-08-23 17:08 ` explicitly initializing automatics with specific (garbage) values Jim Meyering
1997-08-23 17:08 ` egcs-ss-970821 -- bad comment Joel Sherrill
1997-08-24  3:43 egcs has some bad optimization bug H.J. Lu
1997-08-24  3:43 ` explicitly initializing automatics with specific (garbage) values Andi Kleen
1997-08-24  3:43 Jim Meyering
1997-08-24  3:43 ` Richard Henderson

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