Message ID | 20131024090529.GV19160@lug-owl.de |
---|---|
State | New |
Headers | show |
On Oct 24, 2013, at 2:05 AM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote: > - enum raw_str_phase { RAW_STR_PREFIX, RAW_STR, RAW_STR_SUFFIX }; > - raw_str_phase phase = RAW_STR_PREFIX; > + enum raw_str_phase { RAW_STR_PREFIX, RAW_STR, RAW_STR_SUFFIX } phase = RAW_STR_PREFIX; Since no one else chimed in… seems obvious to me… though the line is too long. Better likely would be to just say: enum raw_str_phase phase = RAW_STR_PREFIX;
On Thu, Oct 24, 2013 at 6:22 PM, Mike Stump <mikestump@comcast.net> wrote: > On Oct 24, 2013, at 2:05 AM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote: >> - enum raw_str_phase { RAW_STR_PREFIX, RAW_STR, RAW_STR_SUFFIX }; >> - raw_str_phase phase = RAW_STR_PREFIX; >> + enum raw_str_phase { RAW_STR_PREFIX, RAW_STR, RAW_STR_SUFFIX } phase = RAW_STR_PREFIX; > > Since no one else chimed in… seems obvious to me… though the line is too long. Better likely would be to just say: No it does not due to in C++ the name is injected without the enum tag too. > > enum raw_str_phase phase = RAW_STR_PREFIX; This is a good work around but please add a comment of why this is needed (to work around a bug in XLC++). Thanks, Andrew
On Oct 24, 2013, at 6:25 PM, Andrew Pinski <pinskia@gmail.com> wrote: >> enum raw_str_phase phase = RAW_STR_PREFIX; > > This is a good work around but please add a comment of why this is > needed (to work around a bug in XLC++). Oh, curious, I was assuming that file was compiled by the C compiler… not as obvious as I first thought.
>>>>> "Andrew" == Andrew Pinski <pinskia@gmail.com> writes: >> enum raw_str_phase phase = RAW_STR_PREFIX; Andrew> This is a good work around but please add a comment of why this is Andrew> needed (to work around a bug in XLC++). I agree. It's ok with this update. thanks, Tom
diff --git a/libcpp/lex.c b/libcpp/lex.c index ed794d5..4fa244d 100644 --- a/libcpp/lex.c +++ b/libcpp/lex.c @@ -1377,8 +1377,7 @@ lex_raw_string (cpp_reader *pfile, cpp_token *token, const uchar *base, uchar temp_buffer[18]; const uchar *orig_base; unsigned int raw_prefix_len = 0, raw_suffix_len = 0; - enum raw_str_phase { RAW_STR_PREFIX, RAW_STR, RAW_STR_SUFFIX }; - raw_str_phase phase = RAW_STR_PREFIX; + enum raw_str_phase { RAW_STR_PREFIX, RAW_STR, RAW_STR_SUFFIX } phase = RAW_STR_PREFIX; enum cpp_ttype type; size_t total_len = 0; /* Index into temp_buffer during phases other than RAW_STR,