Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: DBS on November 24, 2010, 08:38:17 pm

Title: ‘=’, ‘,’, ‘;’, ‘
Post by: DBS on November 24, 2010, 08:38:17 pm
I use Code::blocks 10.05 on Win 7 Professional with gnu gcc cygwin 1.7.  Some errors are displayed like this: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before â€

I have fixed the code problem, but I am still unable to decode this message.  I have seen an earlier response to a similar question on this Forum, but it did not help to me.  What settings control the build messages encoding?

Many Thanks.
Title: Re: ‘=’, ‘,’, ‘;’, ‘
Post by: nightlight on November 26, 2010, 10:36:35 pm
I am seeing the same problem. Did you manage to solve it?
Title: Re: ‘=’, ‘,’, ‘;’, ‘
Post by: oBFusCATed on November 27, 2010, 12:47:55 am
Have you checked your locale settings?
What is the output when you execute gcc/g++ from the command line/shell?
Title: Re: ‘=’, ‘,’, ‘;’, ‘
Post by: Jenna on November 27, 2010, 01:00:01 am
Don't forget cygwins locale settings, too.
Title: Re: ‘=’, ‘,’, ‘;’, ‘
Post by: nightlight on November 29, 2010, 05:02:22 pm
Have you checked your locale settings?
What is the output when you execute gcc/g++ from the command line/shell?

The problem is for utf8 coded characters (fancy unicode quotes around error messages) produced by cygwin gcc. The text inside the quotes is OK (regular us-en). I couldn't find the character encoding for build log (there is one only for input files into editor). Here is an example of a gcc message output:

C:\C\exp\cyg\main.c||In function ‘ticks2’:|
C:\C\exp\cyg\main.c|19|warning: format ‘%X’ expects type ‘unsigned int’, but argument 2 has type ‘time_t’|
C:\C\exp\cyg\main.c|19|warning: format ‘%X’ expects type ‘unsigned int’, but argument 3 has type ‘long int’|
C:\C\exp\cyg\main.c|19|warning: format ‘%X’ expects type ‘unsigned int’, but argument 2 has type ‘time_t’|
C:\C\exp\cyg\main.c|19|warning: format ‘%X’ expects type ‘unsigned int’, but argument 3 has type ‘long int’|
||=== Build finished: 0 errors, 4 warnings ===|

As you can see only the unicode quotes (in utf8) were not understood by the CB Build log display. Compiling from command line in cygwin shell produces correct output:

C:/C/exp/cyg/main.c: In function `ticks2':
C:/C/exp/cyg/main.c:19: warning: format `%X' expects type `unsigned int', but argument 2 has type `time_t'
C:/C/exp/cyg/main.c:19: warning: format `%X' expects type `unsigned int', but argument 3 has type `long int'
C:/C/exp/cyg/main.c:19: warning: format `%X' expects type `unsigned int', but argument 2 has type `time_t'
C:/C/exp/cyg/main.c:19: warning: format `%X' expects type `unsigned int', but argument 3 has type `long int'

Title: Re: ‘=’, ‘,’, ‘;’, ‘
Post by: Jenna on November 29, 2010, 08:50:02 pm
My guess:
the problem is, that cygwin does not use the system default encoding, but C::B does (for logger).
This works in cygwin-shell (of course), but not from inside C::B.

If you turn on full commandline logging and type the exact same command as C::B uses in a normal windows console and see the results.
Title: Re: ‘=’, ‘,’, ‘;’, ‘
Post by: eranif on November 29, 2010, 09:02:24 pm
Try setting the environment variable LC_ALL to 'C' from within code::blocks and run it again

Eran
Title: Re: ‘=’, ‘,’, ‘;’, ‘
Post by: nightlight on November 29, 2010, 10:58:35 pm
Try setting the environment variable LC_ALL to 'C' from within code::blocks and run it again

Eran


Thanks, that fixed it!