public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Huh?
@ 1997-08-19 17:54 Peter Seebach
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Seebach @ 1997-08-19 17:54 UTC (permalink / raw)
  To: egcs

I'm curious about this...

I submitted some patches, some time ago, to add warnings for non-int-main.

They have all been changed to "pedwarn".

All of my belief that "-pedantic" should be the default aside, this is
Just Plain Wrong.

Why?

Because, it is a flat out *bug* that
	gcc -Wmain
will not warn for suspicious declarations of main.

These are *NOT* pedantic warnings, they are plain old warnings, which are
desirable if warn_main has been set.  My default behavior was to set -Wmain
if -Wall is set, unless one has selected a freestanding environment; this
may or may not be correct, but as long as there is a warn_main, it is a
bug for the warnings to be under pedwarn.

If anyone knows when or why this was changed, I'd like to know, because I
am vaguely miffed that some code I put some real effort into (mostly
because I'd never even looked at gcc internals before :) ) has been,
AFAIK, gratuitously broken.

If someone has a problem with -Wall implying -Wmain, the thing to do is
not to break -Wmain, but to remove it from the code that handles -Wall,
and presumably also to change the documentation.  :)

I would recommend, however, that -Wmain be implied by -Wall; it is a
common, easy-to-fix, error to misdeclare main.

N.B.:  If reverting pedwarn to warn, *DO NOT* do this to the warning for the
3rd argument if it is (char **), this is intentionally only a pedwarn, because
envp used to be The Right Thing, and is specifically documented as a common
extension in C89.

-s

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

* Re: Huh?
  1998-10-23 14:37   ` Huh? Martin von Loewis
@ 1998-10-24 12:12     ` Joe Buck
  0 siblings, 0 replies; 9+ messages in thread
From: Joe Buck @ 1998-10-24 12:12 UTC (permalink / raw)
  To: Martin von Loewis; +Cc: rjoiner, N8TM, egcs

> The makefile will call bison if the C code is absent or
> out-of-date. I'm not sure which one happened in the snapshot, I'm sure
> this was a mistake, though.

It has been a frequent occurrence that snapshots or even releases
have out-of-date derived files (outputs of bison or makeinfo).
> Regards,
> Martin
> 


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

* Re: Huh?
  1998-10-22 21:15 ` Huh? Randy Joiner
@ 1998-10-23 14:37   ` Martin von Loewis
  1998-10-24 12:12     ` Huh? Joe Buck
  0 siblings, 1 reply; 9+ messages in thread
From: Martin von Loewis @ 1998-10-23 14:37 UTC (permalink / raw)
  To: rjoiner; +Cc: N8TM, egcs

> Also, inclusion of any and all necessary files, apps, tools, lib's, etc.
> for compilation on the Web site would be _extremely_ useful.  I've looked
> and could find ref. only to the testsuite tools needed.

I'm not sure this has been settled, yet, so I give my 0.02 EUR.  For
release gcc versions, and (AFAIK) egcs snapshots, yacc/bison needs not
to be present for the build process. This is because the bison output
(which is C source code) should be included.

The makefile will call bison if the C code is absent or
out-of-date. I'm not sure which one happened in the snapshot, I'm sure
this was a mistake, though.

Regards,
Martin

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

* Re: Huh?
       [not found] <435ded07.362ec94c@aol.com>
@ 1998-10-22 21:15 ` Randy Joiner
  1998-10-23 14:37   ` Huh? Martin von Loewis
  0 siblings, 1 reply; 9+ messages in thread
From: Randy Joiner @ 1998-10-22 21:15 UTC (permalink / raw)
  To: N8TM; +Cc: Egcs Mail List

On Thu, 22 Oct 1998 N8TM@aol.com wrote:

> In a message dated 10/21/98 8:23:45 PM Pacific Daylight Time, rjoiner@tc.net
> writes:
> 
> > bison: Command not found
> bison is a parser generator, similar to yacc, typically used in the generation
> of gnu compilers.  It's one of the optional development packages in linux,
> comes automatically with gnu-win32; otherwise get the source from ftp.gnu.org
> or a mirror and build it.  It was always needed on some systems before gcc
> could be configured; now it's needed on all systems to build java.
> 

Thanks, I now know what bison is.

However, it hasn't been needed in the last several snapshot's, until 1019
(or possibly 1012, as I skipped that one).

Linux is not the system I'm attempting to compile this on, and any
assumption of a flavor of OS is not the Right Thing(tm).  

Also, inclusion of any and all necessary files, apps, tools, lib's, etc.
for compilation on the Web site would be _extremely_ useful.  I've looked
and could find ref. only to the testsuite tools needed.

Thanks,
Rand.


__
Randall Joiner,  Prestidictator/Son-of-a-bezelwort/Sysadmin
This may seem a bit weird, but that's okay, because it is weird.
-- Man page for Perl Data Structures (man perldata)


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

* Re: Huh?
  1998-10-21 11:41 Huh? Randy Joiner
@ 1998-10-21 22:10 ` Per Bothner
  0 siblings, 0 replies; 9+ messages in thread
From: Per Bothner @ 1998-10-21 22:10 UTC (permalink / raw)
  To: Randy Joiner; +Cc: Egcs Mail List

> WTF is bison?  And why do I need it to compile the snapshot?

(1) bison is the GNU replacement for yacc.

(2) I made a mistake in migrating java;  the current egcs
(and future snapshots) should have things fixed that the
cvs repository again includes the bison-generated parse.c
(and thus you should you no longer need bison).

(3) However, it is likely that at somepoint we will no longer
include bison-generated files in the cvs tree.  In that case,
if you want to build from the cvs sources, you will need
bison.  However, actual *release* (and snapshot) *tar* files
will still include the bison-generated files.

(4) In any case, you might want to remove or not build the java
stuff; without a run-time (coming soon!), it won't do you much good.

	--Per Bothner
Cygnus Solutions     bothner@cygnus.com     http://www.cygnus.com/~bothner

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

* Re:  Huh?
@ 1998-10-21 19:20 TTK Ciar
  0 siblings, 0 replies; 9+ messages in thread
From: TTK Ciar @ 1998-10-21 19:20 UTC (permalink / raw)
  To: egcs, rjoiner

> WTF is bison?  And why do I need it to compile the snapshot?

  Bison is GNU's version of yacc, the compiler-compiler.  You
need it because critical parts of the compiler are written in
yacc scripts (ie, those .y files).  Bison comes with the gcc
package.  You should compile it before trying to make gcc, if
you don't already have it.

  -- TTK


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

* Huh?
@ 1998-10-21 11:41 Randy Joiner
  1998-10-21 22:10 ` Huh? Per Bothner
  0 siblings, 1 reply; 9+ messages in thread
From: Randy Joiner @ 1998-10-21 11:41 UTC (permalink / raw)
  To: Egcs Mail List

WTF is bison?  And why do I need it to compile the snapshot?

bison -t -v  --name-prefix=java_ -o parse.c \
  ../../../egcs-19981019/gcc/java/parse.y
make[3]: bison: Command not found
make[3]: *** [parse.c] Error 127

Rand.
__
Randall Joiner,  Prestidictator/Son-of-a-bezelwort/Sysadmin
This may seem a bit weird, but that's okay, because it is weird.
-- Man page for Perl Data Structures (man perldata)


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

* Re: Huh?
@ 1997-08-29 21:09 Jim Wilson
  0 siblings, 0 replies; 9+ messages in thread
From: Jim Wilson @ 1997-08-29 21:09 UTC (permalink / raw)
  To: egcs

	I submitted some patches, some time ago, to add warnings for non-int-main.
	They have all been changed to "pedwarn".
	All of my belief that "-pedantic" should be the default aside, this is
	Just Plain Wrong.

I think you are confused by the difference between `warn' and `pedwarn'.
Both of then give a warning always, so the change is harmless as far as you
are concerned.  -Wmain will still always give a warning.

The difference between `warn' and `pedwarn' is that pedwarn gives an
error if -pedantic-errors is used.  This may not be what you intended, but
it is a separate problem from what you are complaining about.

If you want to give a warning only when -fpedantic, then you must use
	if (pedantic)
	  pedwarn (...);

Jim

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

* Re: Huh?
@ 1997-08-22 19:23 Peter Gerwinski
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Gerwinski @ 1997-08-22 19:23 UTC (permalink / raw)
  To: egcs

According to Peter Seebach:
> 
> I submitted some patches, some time ago, to add warnings for non-int-main.
> 
> They have all been changed to "pedwarn".
> 
> All of my belief that "-pedantic" should be the default aside, this is
> Just Plain Wrong.
> 
> Why?
> 
> Because, it is a flat out *bug* that
> 	gcc -Wmain
> will not warn for suspicious declarations of main.
> 
> These are *NOT* pedantic warnings, they are plain old warnings, which are
> desirable if warn_main has been set.  My default behavior was to set -Wmain
> if -Wall is set, unless one has selected a freestanding environment; this
> may or may not be correct, but as long as there is a warn_main, it is a
> bug for the warnings to be under pedwarn.

Without knowing the details of these changes:  `pedwarn()' is something
*stronger* than just `warning()'.  It does warn *without* `-pedantic',
but in contrast to just `warning()' it converts to an error message if
somebody specifies `-pedantic-errors'.

> If anyone knows when or why this was changed, I'd like to know, because I
> am vaguely miffed that some code I put some real effort into (mostly
> because I'd never even looked at gcc internals before :) ) has been,
> AFAIK, gratuitously broken.

I only can guess, but I suspect that the person who changed this thought
that your warnings are more important than you thought.

> N.B.:  If reverting pedwarn to warn, *DO NOT* do this to the warning for the
> 3rd argument if it is (char **), this is intentionally only a pedwarn, because
> envp used to be The Right Thing, and is specifically documented as a common
> extension in C89.

Then do something like

    if (pedantic)
      pedwarn ("whatever");

because without the `if' you will always get that warning - with or
without `-pedantic'.

Greetings,

    Peter

 Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer
peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [970201]
 maintainer GNU Pascal [970714] - http://home.pages.de/~gnu-pascal/ [970125]

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

end of thread, other threads:[~1998-10-24 12:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-08-19 17:54 Huh? Peter Seebach
1997-08-22 19:23 Huh? Peter Gerwinski
1997-08-29 21:09 Huh? Jim Wilson
1998-10-21 11:41 Huh? Randy Joiner
1998-10-21 22:10 ` Huh? Per Bothner
1998-10-21 19:20 Huh? TTK Ciar
     [not found] <435ded07.362ec94c@aol.com>
1998-10-22 21:15 ` Huh? Randy Joiner
1998-10-23 14:37   ` Huh? Martin von Loewis
1998-10-24 12:12     ` Huh? Joe Buck

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