This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, libcpp, rs6000]: context-sensitive Altivec keywords


This breaks various testcases with -std=c99 -pedantic (together with 
-maltivec or a -mcpu option that implies -maltivec).

Test 1 (valid code):

#ifdef vector
#error "vector defined"
#endif
int x;

The conditional macros must be invisible to #ifdef/#ifndef/defined().

Test 2 (valid code):

typedef int vector;
vector pixel;

The context-sensitivity isn't restricting the conditional macros to cases 
where the code would otherwise be invalid.

Test 3 (invalid code):

vector pixel x;

This code is syntactically invalid, so requires a diagnostic with -std=c99 
-pedantic (even if you choose to compile it with the Altivec keyword rules 
after giving such a diagnostic).

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]