Author Topic: ‘=’, ‘,’, ‘;’, ‘  (Read 6297 times)

Offline DBS

  • Single posting newcomer
  • *
  • Posts: 5
‘=’, ‘,’, ‘;’, ‘
« 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.

Offline nightlight

  • Multiple posting newcomer
  • *
  • Posts: 21
Re: ‘=’, ‘,’, ‘;’, ‘
« Reply #1 on: November 26, 2010, 10:36:35 pm »
I am seeing the same problem. Did you manage to solve it?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: ‘=’, ‘,’, ‘;’, ‘
« Reply #2 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?
(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!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: ‘=’, ‘,’, ‘;’, ‘
« Reply #3 on: November 27, 2010, 01:00:01 am »
Don't forget cygwins locale settings, too.

Offline nightlight

  • Multiple posting newcomer
  • *
  • Posts: 21
Re: ‘=’, ‘,’, ‘;’, ‘
« Reply #4 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'


Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: ‘=’, ‘,’, ‘;’, ‘
« Reply #5 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.

Offline eranif

  • Regular
  • ***
  • Posts: 256
Re: ‘=’, ‘,’, ‘;’, ‘
« Reply #6 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

Offline nightlight

  • Multiple posting newcomer
  • *
  • Posts: 21
Re: ‘=’, ‘,’, ‘;’, ‘
« Reply #7 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!