public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re:  Should warnings be issued for unrecognised pragmas ?
@ 1997-10-17 15:51 Mike Stump
  0 siblings, 0 replies; 22+ messages in thread
From: Mike Stump @ 1997-10-17 15:51 UTC (permalink / raw)
  To: jbuck, meissner; +Cc: egcs, nickc

> From: Joe Buck <jbuck@synopsys.com>
> Date: Fri, 17 Oct 97 14:36:46 PDT

> It's a minor point, but why not allow the British spelling as a
> synonym?

I am against this.  We need to pick a predictable spelling, a
canonical one, and use it and stick to it.

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

* Re: Should warnings be issued for unrecognised pragmas ?
  1997-10-20 10:49               ` Nick Clifton
@ 1997-10-20 13:24                 ` Joe Buck
  0 siblings, 0 replies; 22+ messages in thread
From: Joe Buck @ 1997-10-20 13:24 UTC (permalink / raw)
  To: Nick Clifton; +Cc: jbuck, egcs

> Oh, sorry.  So what you are really saying is that -Wall should not
> warn about unknown pragmas unless there is an easy way to avoid or
> prevent the warning, and that using conditional compilation is not the
> solution because there are just too many places where it would be
> needed in the "Effective C++" class library, right ?

Conditional compilation is no problem (it does not make the code worse).

> Does doing:
> 
> 	-Wall -Wno-unknown-pragmas
> 
> count as avoiding the warnings, and if so, is it an acceptible
> solution ?

Yes, that's acceptable in this case (since people who want to just say
"-Wall" can surround the unknown pragmas with #ifdefs).  The cases
where I think -Wall -Wno-<flag> is unacceptable is if there is no
way to have just -Wall work without making the object code worse.



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

* Re: Should warnings be issued for unrecognised pragmas ?
  1997-10-20 10:43             ` Joe Buck
@ 1997-10-20 10:49               ` Nick Clifton
  1997-10-20 13:24                 ` Joe Buck
  0 siblings, 1 reply; 22+ messages in thread
From: Nick Clifton @ 1997-10-20 10:49 UTC (permalink / raw)
  To: jbuck; +Cc: egcs

> From: Joe Buck <jbuck@synopsys.com>
> Date: Mon, 20 Oct 97 10:43:41 PDT
> 
> > > From: Joe Buck <jbuck@synopsys.com>
> > > Date: Sat, 18 Oct 97 12:55:55 PDT
> > > 
> > > Because large numbers of people use -Wall all the time on every build,
> > > no warning should be added to -Wall that cannot be suppressed without
> > > making the code worse.  Since it's easy to supress compiler-specific
> > > pragmas belonging to other compilers with #ifdef __Green_Hills__ or
> > > the like, I don't care in this case whether -Wall objects or not.
> > > So -Wunrecognized_pragmas could be in -Wall.  On the other hand,
> > > some of the "Effective C++" warnings can't be suppressed without
> > > making some classes needlessly larger, so they can't be in -Wall.
> > > 
> > 
> > Can you tell me what these pragmas are, then I can make sure that the
> > patch will not generate warnings for them.  I assume that it is OK for
> > GCC to ignore these pragmas ?
> 
> You misunderstood me, I think.  I have no problem with warning about
> all unrecognized pragmas in -Wall .  I was just talking about general
> philosophy (put stuff in -Wall only if the user can always avoid the
> warning without penalty).

Oh, sorry.  So what you are really saying is that -Wall should not
warn about unknown pragmas unless there is an easy way to avoid or
prevent the warning, and that using conditional compilation is not the
solution because there are just too many places where it would be
needed in the "Effective C++" class library, right ?

Does doing:

	-Wall -Wno-unknown-pragmas

count as avoiding the warnings, and if so, is it an acceptible
solution ?

Nick


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

* Re: Should warnings be issued for unrecognised pragmas ?
  1997-10-20 10:32           ` Nick Clifton
@ 1997-10-20 10:43             ` Joe Buck
  1997-10-20 10:49               ` Nick Clifton
  0 siblings, 1 reply; 22+ messages in thread
From: Joe Buck @ 1997-10-20 10:43 UTC (permalink / raw)
  To: Nick Clifton; +Cc: jbuck, egcs

> > From: Joe Buck <jbuck@synopsys.com>
> > Date: Sat, 18 Oct 97 12:55:55 PDT
> > 
> > Because large numbers of people use -Wall all the time on every build,
> > no warning should be added to -Wall that cannot be suppressed without
> > making the code worse.  Since it's easy to supress compiler-specific
> > pragmas belonging to other compilers with #ifdef __Green_Hills__ or
> > the like, I don't care in this case whether -Wall objects or not.
> > So -Wunrecognized_pragmas could be in -Wall.  On the other hand,
> > some of the "Effective C++" warnings can't be suppressed without
> > making some classes needlessly larger, so they can't be in -Wall.
> > 
> 
> Can you tell me what these pragmas are, then I can make sure that the
> patch will not generate warnings for them.  I assume that it is OK for
> GCC to ignore these pragmas ?

You misunderstood me, I think.  I have no problem with warning about
all unrecognized pragmas in -Wall .  I was just talking about general
philosophy (put stuff in -Wall only if the user can always avoid the
warning without penalty).



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

* Re: Should warnings be issued for unrecognised pragmas ?
@ 1997-10-20 10:32 Nick Clifton
  0 siblings, 0 replies; 22+ messages in thread
From: Nick Clifton @ 1997-10-20 10:32 UTC (permalink / raw)
  To: richard.earnshaw; +Cc: egcs

> Date: Sat, 18 Oct 1997 11:05:19 +0100
> From: Richard Earnshaw <rearnsha@arm.com>
> 
> How about -Wunknown-pragmas ?  It's also shorter.
> 
> Richard.

An excellent idea.  I have made the change.

Nick


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

* Re: Should warnings be issued for unrecognised pragmas ?
  1997-10-18 12:56         ` Joe Buck
@ 1997-10-20 10:32           ` Nick Clifton
  1997-10-20 10:43             ` Joe Buck
  0 siblings, 1 reply; 22+ messages in thread
From: Nick Clifton @ 1997-10-20 10:32 UTC (permalink / raw)
  To: jbuck; +Cc: egcs

> From: Joe Buck <jbuck@synopsys.com>
> Date: Sat, 18 Oct 97 12:55:55 PDT
> 
> Because large numbers of people use -Wall all the time on every build,
> no warning should be added to -Wall that cannot be suppressed without
> making the code worse.  Since it's easy to supress compiler-specific
> pragmas belonging to other compilers with #ifdef __Green_Hills__ or
> the like, I don't care in this case whether -Wall objects or not.
> So -Wunrecognized_pragmas could be in -Wall.  On the other hand,
> some of the "Effective C++" warnings can't be suppressed without
> making some classes needlessly larger, so they can't be in -Wall.
> 

Can you tell me what these pragmas are, then I can make sure that the
patch will not generate warnings for them.  I assume that it is OK for
GCC to ignore these pragmas ?

Nick


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

* Re: Should warnings be issued for unrecognised pragmas ?
  1997-10-17 19:44     ` Joe Buck
@ 1997-10-19  5:54       ` Dave Love
  0 siblings, 0 replies; 22+ messages in thread
From: Dave Love @ 1997-10-19  5:54 UTC (permalink / raw)
  To: egcs

>>>>> "Joe" == Joe Buck <jbuck@synopsys.com> writes:

 Joe> Several suffixes are different in Britain and America.
 Joe> Americans use a z here.

FWIW, `recognize' is correct British English.  (I can supply ispell
patches.)

-- 
Dominus illuminatio mea

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

* Re: Should warnings be issued for unrecognised pragmas ?
  1997-10-17 15:06       ` Nick Clifton
@ 1997-10-18 12:56         ` Joe Buck
  1997-10-20 10:32           ` Nick Clifton
  0 siblings, 1 reply; 22+ messages in thread
From: Joe Buck @ 1997-10-18 12:56 UTC (permalink / raw)
  To: Nick Clifton; +Cc: koch, egcs

> And how much is too much.  Personally I suspect that most programmers
> only use -Wall occaisionally to see how their source is fairing,

No, I use -Wall all the time on every build, so do many programmers.
When I take over someone else's code who was less careful, -Wall usually
finds a bug or two.

> because they are already overwhelmed by the number of warnings it
> produces, especially if they have inherited some code from somebody
> else. 

It's worth fixing the warnings.

Because large numbers of people use -Wall all the time on every build,
no warning should be added to -Wall that cannot be suppressed without
making the code worse.  Since it's easy to supress compiler-specific
pragmas belonging to other compilers with #ifdef __Green_Hills__ or
the like, I don't care in this case whether -Wall objects or not.
So -Wunrecognized_pragmas could be in -Wall.  On the other hand,
some of the "Effective C++" warnings can't be suppressed without
making some classes needlessly larger, so they can't be in -Wall.



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

* Re: Should warnings be issued for unrecognised pragmas ?
  1997-10-17 15:05   ` Nick Clifton
  1997-10-17 19:44     ` Joe Buck
@ 1997-10-18  3:04     ` Richard Earnshaw
  1 sibling, 0 replies; 22+ messages in thread
From: Richard Earnshaw @ 1997-10-18  3:04 UTC (permalink / raw)
  To: Nick Clifton; +Cc: rearnsha

> > From: Joe Buck <jbuck@synopsys.com>
> > Date: Fri, 17 Oct 97 14:36:46 PDT
> > 
> > > Please change -wunrecognised-pragmas to -Wunrecognized-pragmas for
> > > consistancy.
> > 
> > Hmm.  It's a minor point, but why not allow the British spelling as a synonym?
> > 
> Which British spelling would that be ?
> 
> Nick

How about -Wunknown-pragmas ?  It's also shorter.

Richard.




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

* Re: Should warnings be issued for unrecognised pragmas ?
  1997-10-17 15:05   ` Nick Clifton
@ 1997-10-17 19:44     ` Joe Buck
  1997-10-19  5:54       ` Dave Love
  1997-10-18  3:04     ` Richard Earnshaw
  1 sibling, 1 reply; 22+ messages in thread
From: Joe Buck @ 1997-10-17 19:44 UTC (permalink / raw)
  To: Nick Clifton; +Cc: jbuck, meissner, egcs

> > > Please change -wunrecognised-pragmas to -Wunrecognized-pragmas for
> > > consistancy.

> > Hmm.  It's a minor point, but why not allow the British spelling as a synonym?

> Which British spelling would that be ?

Several suffixes are different in Britain and America.  Americans use a
z here.

British		American
-ise		-ize
-our		-or
-re		-er


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

* Re:  Should warnings be issued for unrecognised pragmas ?
@ 1997-10-17 19:44 James L. Dein
  0 siblings, 0 replies; 22+ messages in thread
From: James L. Dein @ 1997-10-17 19:44 UTC (permalink / raw)
  To: jbuck, meissner, mrs; +Cc: egcs, nickc

>  From owner-egcs@cygnus.com Fri Oct 17 19:05 PDT 1997
>  Date: Fri, 17 Oct 1997 15:50:56 -0700
>  From: mrs@wrs.com (Mike Stump)
>  To: jbuck@synopsys.com, meissner@cygnus.com
>  Subject: Re:  Should warnings be issued for unrecognised pragmas ?
>  Cc: egcs@cygnus.com, nickc@cygnus.com
>  
>  > From: Joe Buck <jbuck@synopsys.com>
>  > Date: Fri, 17 Oct 97 14:36:46 PDT
>  
>  > It's a minor point, but why not allow the British spelling as a
>  > synonym?
>  
>  I am against this.  We need to pick a predictable spelling, a
>  canonical one, and use it and stick to it.

How about "unknown-pragmas"?  Same spelling on every side of the Atlantic (and 
other oceans).

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

* Re: Should warnings be issued for unrecognised pragmas ?
  1997-10-17 15:05   ` Nick Clifton
@ 1997-10-17 15:06     ` Donald Koch
  1997-10-17 15:06       ` Nick Clifton
  0 siblings, 1 reply; 22+ messages in thread
From: Donald Koch @ 1997-10-17 15:06 UTC (permalink / raw)
  To: Nick Clifton; +Cc: koch, egcs

> > Date: Fri, 17 Oct 1997 14:59:46 -0400
> > From: Donald Koch <koch@cognex.com>
> > 
> > > I am currently writting a patch for gcc2 that implements a new command
> > > line option '-wunrecognised-pragmas' which will cause warning messages
> > > to be generated when GCC encounters pragmas which is does not handle.
> > > At the moment this patch also enables these warnings if -Wall is
> > > enabled, expect for the case where the pragmas are in system header
> > > files.   Is this the right thing to do ?
> > 
> > If you mean by "this", enabling it with -Wall, no.
> > 
> > Consider the use of "-Werror -Wall", where the desired effect is to
> > make sure there are no iffy constructs in the code; would failure
> > to compile because there was an unrecognized pragma which is needed
> > for some other compiler/platform be desirable?
> 
> No, but failure to compile because the code contained an unrecognised
> pragma which was intended to effect code generation is desirable.  Of
> course to achieve the effect you want you can do this:
> 
> 	-Werror -Wall -Wno-unrecognised-pragmas
> 
> 
> > -Wall check for too many useful things, which is what it should do.
> 
> Sorry, I do not understand that sentance.
[...]
> Nick

Sorry, brain slipped out gear mid-sentence.  -Wall should check for
the most useful warnings.  Adding too many will make it unusable.
The question basically is: is -Wunrecognised-pragmas going to be used
much more often than not when -Wall is used?  I don't want to have to
be adding too many -Wno-... flags.  (Maybe we should add a -Wsome
or -Wmost flag? ;-)  I guess it depends on what is meant by "all".
(According to the documentation, this would be determined by whether
-Wunreconised-pragmas came before or after the description of -Wall.)

I take it that we are targetting some specific pragmas.  Which ones?

-d



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

* Re: Should warnings be issued for unrecognised pragmas ?
  1997-10-17 14:36 ` Joe Buck
  1997-10-17 15:05   ` Nick Clifton
@ 1997-10-17 15:06   ` Nick Clifton
  1 sibling, 0 replies; 22+ messages in thread
From: Nick Clifton @ 1997-10-17 15:06 UTC (permalink / raw)
  To: jbuck; +Cc: meissner, egcs

> From: Joe Buck <jbuck@synopsys.com>
> Date: Fri, 17 Oct 97 14:36:46 PDT
> 
> > Please change -wunrecognised-pragmas to -Wunrecognized-pragmas for
> > consistancy.
> 
> Hmm.  It's a minor point, but why not allow the British spelling as a synonym?

Ooops - I have just noticed the spelling difference, sorry!

As it happenes I have used the British spelling in the patch I
produced.  Is this going to be a problem ?

Nick


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

* Re: Should warnings be issued for unrecognised pragmas ?
  1997-10-17 15:06     ` Donald Koch
@ 1997-10-17 15:06       ` Nick Clifton
  1997-10-18 12:56         ` Joe Buck
  0 siblings, 1 reply; 22+ messages in thread
From: Nick Clifton @ 1997-10-17 15:06 UTC (permalink / raw)
  To: koch; +Cc: egcs

> Date: Fri, 17 Oct 1997 17:14:00 -0400
> From: Donald Koch <koch@cognex.com>
> 
> > > Date: Fri, 17 Oct 1997 14:59:46 -0400
> > > From: Donald Koch <koch@cognex.com>
> > > 
> > > -Wall check for too many useful things, which is what it should do.
> > 
> > Sorry, I do not understand that sentance.
> [...]
> > Nick
> 
> Sorry, brain slipped out gear mid-sentence.  -Wall should check for
> the most useful warnings.  Adding too many will make it unusable.
> The question basically is: is -Wunrecognised-pragmas going to be used
> much more often than not when -Wall is used?  I don't want to have to
> be adding too many -Wno-... flags.  (Maybe we should add a -Wsome
> or -Wmost flag? ;-)  I guess it depends on what is meant by "all".

And how much is too much.  Personally I suspect that most programmers
only use -Wall occaisionally to see how their source is fairing,
because they are already overwhelmed by the number of warnings it
produces, especially if they have inherited some code from somebody
else. 

> (According to the documentation, this would be determined by whether
> -Wunreconised-pragmas came before or after the description of
> -Wall.)
True.

> I take it that we are targetting some specific pragmas.  Which ones?

True.  The original work came up when we were asked to provide a port
that would support code that had previously been compiled by the Green
Hills toolsuite.  That code used Green Hills specific pragmas in
various places, and in the course of improving the code that handles
this situation I noticed that GCC was not issuing any warnings when it
did not recognise their pragmas.  I am not sure if it is appropriate
for me to describe specific pragmas, since this is really a generic
problem, rather than one of compatibility with a particualr vendor's
toolchain.

To take a specific, invented example however, the "pack" pragma is a 
case in point.  As it happens GCC does handle this pragma, but if it
did not then it could cause all kinds of hard to find errors in the
user's programs, when their structures do not match the sizes expected
by the code.  Not having a warning message to help idenitfy this
situation would only makes finding the "bug" that much harder.

Nick





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

* Re: Should warnings be issued for unrecognised pragmas ?
  1997-10-17 14:36 ` Donald Koch
@ 1997-10-17 15:05   ` Nick Clifton
  1997-10-17 15:06     ` Donald Koch
  0 siblings, 1 reply; 22+ messages in thread
From: Nick Clifton @ 1997-10-17 15:05 UTC (permalink / raw)
  To: koch; +Cc: egcs

> Date: Fri, 17 Oct 1997 14:59:46 -0400
> From: Donald Koch <koch@cognex.com>
> 
> > I am currently writting a patch for gcc2 that implements a new command
> > line option '-wunrecognised-pragmas' which will cause warning messages
> > to be generated when GCC encounters pragmas which is does not handle.
> > At the moment this patch also enables these warnings if -Wall is
> > enabled, expect for the case where the pragmas are in system header
> > files.   Is this the right thing to do ?
> 
> If you mean by "this", enabling it with -Wall, no.
> 
> Consider the use of "-Werror -Wall", where the desired effect is to
> make sure there are no iffy constructs in the code; would failure
> to compile because there was an unrecognized pragma which is needed
> for some other compiler/platform be desirable?

No, but failure to compile because the code contained an unrecognised
pragma which was intended to effect code generation is desirable.  Of
course to achieve the effect you want you can do this:

	-Werror -Wall -Wno-unrecognised-pragmas


> -Wall check for too many useful things, which is what it should do.

Sorry, I do not understand that sentance.  Do you mean that -Wall
currently checks for too many things and that you think that adding
another thing to the list is too much ?  Or that it is correct for
-Wall to check for as many things as possible (given its specification
of: 'warning about constructions that some users consider
questionable, and that are easy to avoid'), in which case are you
saying that you do not consider unrecognised pragmas to be
questionable constructions ?

Nick



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

* Re: Should warnings be issued for unrecognised pragmas ?
  1997-10-17 14:36 ` Joe Buck
@ 1997-10-17 15:05   ` Nick Clifton
  1997-10-17 19:44     ` Joe Buck
  1997-10-18  3:04     ` Richard Earnshaw
  1997-10-17 15:06   ` Nick Clifton
  1 sibling, 2 replies; 22+ messages in thread
From: Nick Clifton @ 1997-10-17 15:05 UTC (permalink / raw)
  To: jbuck; +Cc: meissner, egcs

> From: Joe Buck <jbuck@synopsys.com>
> Date: Fri, 17 Oct 97 14:36:46 PDT
> 
> > Please change -wunrecognised-pragmas to -Wunrecognized-pragmas for
> > consistancy.
> 
> Hmm.  It's a minor point, but why not allow the British spelling as a synonym?
> 
Which British spelling would that be ?

Nick

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

* Re: Should warnings be issued for unrecognised pragmas ?
  1997-10-16 16:07 Nick Clifton
  1997-10-17  2:31 ` Andreas Schwab
@ 1997-10-17 14:36 ` Donald Koch
  1997-10-17 15:05   ` Nick Clifton
  1 sibling, 1 reply; 22+ messages in thread
From: Donald Koch @ 1997-10-17 14:36 UTC (permalink / raw)
  To: Nick Clifton; +Cc: egcs

> I am currently writting a patch for gcc2 that implements a new command
> line option '-wunrecognised-pragmas' which will cause warning messages
> to be generated when GCC encounters pragmas which is does not handle.
> At the moment this patch also enables these warnings if -Wall is
> enabled, expect for the case where the pragmas are in system header
> files.   Is this the right thing to do ?

If you mean by "this", enabling it with -Wall, no.

Consider the use of "-Werror -Wall", where the desired effect is to
make sure there are no iffy constructs in the code; would failure
to compile because there was an unrecognized pragma which is needed
for some other compiler/platform be desirable?  -Wall check for too
many useful things, which is what it should do.

> The '89 ANSI C standard says:
> "Any pragma that is not recognized by the implementation is ignored."
> 
> It is my opinion that "ignoring" is not the same as "not issuing a
> warning", if such warnings have been requested, and that it is
> important to know if a compiler is ignoring pragmas as they may have
> been intended to affect code generation.
> 
> Any comments ?
> 
> Nick Clifton

Otherwise, I think the '-wunrecognised-pragmas' could be very useful;
e.g., for the case where you only have one platform/compiler and an
unrecognized pragma indicates a typo.

-d



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

* Re:  Should warnings be issued for unrecognised pragmas ?
  1997-10-17 13:57 meissner
@ 1997-10-17 14:36 ` Joe Buck
  1997-10-17 15:05   ` Nick Clifton
  1997-10-17 15:06   ` Nick Clifton
  1997-10-17 14:36 ` Nick Clifton
  1 sibling, 2 replies; 22+ messages in thread
From: Joe Buck @ 1997-10-17 14:36 UTC (permalink / raw)
  To: meissner; +Cc: egcs, nickc

> Please change -wunrecognised-pragmas to -Wunrecognized-pragmas for
> consistancy.

Hmm.  It's a minor point, but why not allow the British spelling as a synonym?

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

* Re: Should warnings be issued for unrecognised pragmas ?
  1997-10-17 13:57 meissner
  1997-10-17 14:36 ` Joe Buck
@ 1997-10-17 14:36 ` Nick Clifton
  1 sibling, 0 replies; 22+ messages in thread
From: Nick Clifton @ 1997-10-17 14:36 UTC (permalink / raw)
  To: meissner; +Cc: egcs

> Date: Fri, 17 Oct 1997 11:04:36 -0400 (EDT)
> From: meissner@cygnus.com
> 
> | I am currently writting a patch for gcc2 that implements a new command
> | line option '-wunrecognised-pragmas' which will cause warning messages
> | to be generated when GCC encounters pragmas which is does not handle.
> | At the moment this patch also enables these warnings if -Wall is
> | enabled, expect for the case where the pragmas are in system header
> | files.   Is this the right thing to do ?
> 
> Please change -wunrecognised-pragmas to -Wunrecognized-pragmas for consistancy.

Whoops, sorry, that was a typo.  The new command line option actually
does use a capital W.

Nick


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

* Re:  Should warnings be issued for unrecognised pragmas ?
@ 1997-10-17 13:57 meissner
  1997-10-17 14:36 ` Joe Buck
  1997-10-17 14:36 ` Nick Clifton
  0 siblings, 2 replies; 22+ messages in thread
From: meissner @ 1997-10-17 13:57 UTC (permalink / raw)
  To: egcs, nickc

| I am currently writting a patch for gcc2 that implements a new command
| line option '-wunrecognised-pragmas' which will cause warning messages
| to be generated when GCC encounters pragmas which is does not handle.
| At the moment this patch also enables these warnings if -Wall is
| enabled, expect for the case where the pragmas are in system header
| files.   Is this the right thing to do ?

Please change -wunrecognised-pragmas to -Wunrecognized-pragmas for consistancy.

| The '89 ANSI C standard says:
| "Any pragma that is not recognized by the implementation is ignored."
| 
| It is my opinion that "ignoring" is not the same as "not issuing a
| warning", if such warnings have been requested, and that it is
| important to know if a compiler is ignoring pragmas as they may have
| been intended to affect code generation.
| 
| Any comments ?
| 
| Nick Clifton
| 

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

* Re: Should warnings be issued for unrecognised pragmas ?
  1997-10-16 16:07 Nick Clifton
@ 1997-10-17  2:31 ` Andreas Schwab
  1997-10-17 14:36 ` Donald Koch
  1 sibling, 0 replies; 22+ messages in thread
From: Andreas Schwab @ 1997-10-17  2:31 UTC (permalink / raw)
  To: Nick Clifton; +Cc: egcs

Nick Clifton <nickc@cygnus.com> writes:

|> The '89 ANSI C standard says:
|> "Any pragma that is not recognized by the implementation is ignored."

|> It is my opinion that "ignoring" is not the same as "not issuing a
|> warning", if such warnings have been requested, and that it is
|> important to know if a compiler is ignoring pragmas as they may have
|> been intended to affect code generation.

|> Any comments ?

A compiler can emit as many warnings as it likes, as long as it correctly
compiles conforming code.

-- 
Andreas Schwab                                      "And now for something
schwab@issan.informatik.uni-dortmund.de              completely different"
schwab@gnu.org

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

* Should warnings be issued for unrecognised pragmas ?
@ 1997-10-16 16:07 Nick Clifton
  1997-10-17  2:31 ` Andreas Schwab
  1997-10-17 14:36 ` Donald Koch
  0 siblings, 2 replies; 22+ messages in thread
From: Nick Clifton @ 1997-10-16 16:07 UTC (permalink / raw)
  To: egcs

I am currently writting a patch for gcc2 that implements a new command
line option '-wunrecognised-pragmas' which will cause warning messages
to be generated when GCC encounters pragmas which is does not handle.
At the moment this patch also enables these warnings if -Wall is
enabled, expect for the case where the pragmas are in system header
files.   Is this the right thing to do ?

The '89 ANSI C standard says:
"Any pragma that is not recognized by the implementation is ignored."

It is my opinion that "ignoring" is not the same as "not issuing a
warning", if such warnings have been requested, and that it is
important to know if a compiler is ignoring pragmas as they may have
been intended to affect code generation.

Any comments ?

Nick Clifton

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

end of thread, other threads:[~1997-10-20 13:24 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-17 15:51 Should warnings be issued for unrecognised pragmas ? Mike Stump
  -- strict thread matches above, loose matches on Subject: below --
1997-10-20 10:32 Nick Clifton
1997-10-17 19:44 James L. Dein
1997-10-17 13:57 meissner
1997-10-17 14:36 ` Joe Buck
1997-10-17 15:05   ` Nick Clifton
1997-10-17 19:44     ` Joe Buck
1997-10-19  5:54       ` Dave Love
1997-10-18  3:04     ` Richard Earnshaw
1997-10-17 15:06   ` Nick Clifton
1997-10-17 14:36 ` Nick Clifton
1997-10-16 16:07 Nick Clifton
1997-10-17  2:31 ` Andreas Schwab
1997-10-17 14:36 ` Donald Koch
1997-10-17 15:05   ` Nick Clifton
1997-10-17 15:06     ` Donald Koch
1997-10-17 15:06       ` Nick Clifton
1997-10-18 12:56         ` Joe Buck
1997-10-20 10:32           ` Nick Clifton
1997-10-20 10:43             ` Joe Buck
1997-10-20 10:49               ` Nick Clifton
1997-10-20 13:24                 ` 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).