|
327 | 327 | # define PERL_UNUSED_CONTEXT
|
328 | 328 | #endif
|
329 | 329 |
|
| 330 | +/* gcc (-ansi) -pedantic doesn't allow gcc statement expressions, |
| 331 | + * g++ allows them but seems to have problems with them |
| 332 | + * (insane errors ensue). |
| 333 | + * g++ does not give insane errors now (RMB 2008-01-30, gcc 4.2.2). |
| 334 | + */ |
| 335 | +#if defined(PERL_GCC_PEDANTIC) || \ |
| 336 | + (defined(__GNUC__) && defined(__cplusplus) && \ |
| 337 | + ((__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ < 2)))) |
| 338 | +# ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN |
| 339 | +# define PERL_GCC_BRACE_GROUPS_FORBIDDEN |
| 340 | +# endif |
| 341 | +#endif |
| 342 | + |
330 | 343 | /* Use PERL_UNUSED_RESULT() to suppress the warnings about unused results
|
331 | 344 | * of function calls, e.g. PERL_UNUSED_RESULT(foo(a, b)). Use it sparingly,
|
332 | 345 | * though, since usually the warning is there for a good reason,
|
|
346 | 359 | * extension __typeof__ and nothing else.
|
347 | 360 | */
|
348 | 361 | #ifndef PERL_UNUSED_RESULT
|
349 |
| -# ifdef __GNUC__ |
| 362 | +# if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) |
350 | 363 | # define PERL_UNUSED_RESULT(v) ({ __typeof__(v) z = (v); (void)sizeof(z); })
|
351 | 364 | # else
|
352 | 365 | # define PERL_UNUSED_RESULT(v) ((void)(v))
|
|
473 | 486 | # endif
|
474 | 487 | #endif
|
475 | 488 |
|
476 |
| -/* gcc (-ansi) -pedantic doesn't allow gcc statement expressions, |
477 |
| - * g++ allows them but seems to have problems with them |
478 |
| - * (insane errors ensue). |
479 |
| - * g++ does not give insane errors now (RMB 2008-01-30, gcc 4.2.2). |
480 |
| - */ |
481 |
| -#if defined(PERL_GCC_PEDANTIC) || \ |
482 |
| - (defined(__GNUC__) && defined(__cplusplus) && \ |
483 |
| - ((__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ < 2)))) |
484 |
| -# ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN |
485 |
| -# define PERL_GCC_BRACE_GROUPS_FORBIDDEN |
486 |
| -# endif |
487 |
| -#endif |
488 |
| - |
489 | 489 | #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus)
|
490 | 490 | # ifndef PERL_USE_GCC_BRACE_GROUPS
|
491 | 491 | # define PERL_USE_GCC_BRACE_GROUPS
|
|
0 commit comments