[Bug c/91285] _Pragma does not work in a useful fashion

2020-01-28 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91285

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2020-01-28
 CC||marxin at gcc dot gnu.org
 Ever confirmed|0   |1

[Bug c/91285] _Pragma does not work in a useful fashion

2019-08-07 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91285

--- Comment #4 from joseph at codesourcery dot com  ---
Note that all the standard C pragmas are even more restricted than GCC's 
statement-like pragmas - the standard pragmas (which aren't implemented in 
GCC) are defined by the C standard to be allowed only "either outside 
external declarations or preceding all explicit declarations and 
statements inside a compound statement".

The wider the range of contexts in which a pragma is permitted, the harder 
it is to define its semantics.  For diagnostic pragmas, note that some 
diagnostics are associated with a *range* of locations within an 
expression, leading to obvious questions about the semantics if diagnostic 
pragma state varies within that range.  (Though that could also arise when 
statement-like pragmas are used within the existing statement expression 
extension.)

[Bug c/91285] _Pragma does not work in a useful fashion

2019-08-04 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91285

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #3 from Eric Gallager  ---
related to or dup of bug 90400 or bug 69558?

[Bug c/91285] _Pragma does not work in a useful fashion

2019-07-29 Thread konrad.schwarz at siemens dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91285

--- Comment #2 from Konrad Schwarz  ---
Thank you for your suggestion -- it does indeed work.

However, this is a workaround for this specific problem --
other pragmas cannot be handled in this way --
consider # pragma GCC optimize ... or # pragma align ...
or # pragma longcall (although the last two
apply to declarations).

[Bug c/91285] _Pragma does not work in a useful fashion

2019-07-29 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91285

--- Comment #1 from Andrew Pinski  ---
Isn't it better to do:

# defineENCLOSING_OBJECT(TYPE, MEMBER, OBJECT)\
((void)sizeof (&((TYPE *) 0)->MEMBER - OBJECT),\
(TYPE *) ((char *) OBJECT - offsetof (TYPE, MEMBER)))

Instead?