News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

‘=’, ‘,’, ‘;’, ‘

Started by DBS, November 24, 2010, 08:38:17 PM

Previous topic - Next topic

DBS

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.

nightlight

I am seeing the same problem. Did you manage to solve it?

oBFusCATed

Have you checked your locale settings?
What is the output when you execute gcc/g++ from the command line/shell?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Jenna


nightlight

Quote from: 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?

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'


Jenna

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.

eranif

Try setting the environment variable LC_ALL to 'C' from within code::blocks and run it again

Eran

nightlight

Quote from: 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


Thanks, that fixed it!