diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0a2918802a6..dd152b9114f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +Fri Oct 16 15:26:24 1998 Dave Brolley + + * c-lex.c (yylex): Fix unaligned access of wchar_t. + Fri Oct 16 10:47:53 1998 Nick Clifton * config/arm/arm.h (TARGET_SWITCHES): Add --help documentation. diff --git a/gcc/c-lex.c b/gcc/c-lex.c index ec1386ae59c..6c0d29f7889 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -2036,15 +2036,13 @@ yylex () /* mbtowc sometimes needs an extra char before accepting */ if (char_len <= i) UNGETC (c); - if (wide_flag) + if (! wide_flag) { - *(wchar_t *)p = wc; - p += sizeof (wc); + p += (i + 1); + c = GETC (); + continue; } - else - p += (i + 1); - c = GETC (); - continue; + c = wc; } #endif /* MULTIBYTE_CHARS */ }