Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » CDT-Helios error reporting(version Helios reports errors where Galileo only reported warnings)
CDT-Helios error reporting [message #729722] Mon, 26 September 2011 16:45 Go to next message
Eclipse UserFriend
hi,

I changed from CDT-Galileo to CDT-Helios and now I get a lot of errors in a project where CDT-Galileo only reported warnings, e.g. unused variables now are errors.

How can I set the compiler to the same sensitivity as in Galileo?

Niko
Re: CDT-Helios error reporting [message #729858 is a reply to message #729722] Tue, 27 September 2011 02:32 Go to previous messageGo to next message
Eclipse UserFriend
Project Properties->C/C++ Build->Settings
But AFAIK there is no difference between Galileo and Helios with regard to compiler settings. Are these indeed compiler errors in the Build Console or are they shown as errors in the Problems View only?

[Updated on: Tue, 27 September 2011 02:33] by Moderator

Re: CDT-Helios error reporting [message #730199 is a reply to message #729858] Tue, 27 September 2011 17:02 Go to previous messageGo to next message
Eclipse UserFriend
The errors are reported as errors in the Problems view.
The overview in the title line of the Problems view tells me:
26 errors, 0 warnings, 0 other

I can run the program, but everytime I am asked if I really want to continue because there are errors.

Well, I can ignore the warning and continue. And the program runs.
But I have curious effects like the following:

The fprintf() statement cannot read floating point values correctly.
An ASCII file containing the line
10.0     # some comment

shall be read by the statements
status = fscanf(stream, "%lf", &sigma_state);
errorcode = read_comment ( stream, comment );

The function read_comment() reads the rest of the line.

The result of reading the line is:
sigma_state=10
comment=.0     # some comment


fscanf() does not recognize 10.0 as a floating point number. It stops reading at the decimal point.
I really cannot understand why such a simple task is going wrong. On my old PC with openSuse 10.3 (not in a virtual machine) and Eclipse Galileo, fscanf() can read the line correctly.

But what else can be the reason?
Has openSuse or Eclipse problems with running in a virtual machine?

My configuration:
Win7 with VM Virtual Box
openSuse 11.3 running in the Virtual Box
Eclipse Helios with Qt-Integration, running on openSuse
Qt 4.7
Re: CDT-Helios error reporting [message #730420 is a reply to message #730199] Wed, 28 September 2011 07:16 Go to previous messageGo to next message
Eclipse UserFriend
That's a localization problem. fscanf uses the decimal separator specified for your lcoale. In your case I guess it is ',' (comma) (German locale).

I would suggest you insert the following into your main.cpp
setlocale(LC_NUMERIC,"C");


fscanf/printf etc. will then stick to decimal point.
Re: CDT-Helios error reporting [message #730673 is a reply to message #730420] Wed, 28 September 2011 16:36 Go to previous messageGo to next message
Eclipse UserFriend
Thank you very much for the setlocale() tip. It helps. Smile

Inserting the statement setlocale(..) at the very first line of main() was not successful. But inserting it after QApplication app(argc, argv) was successful. Now fscanf() is working correctly.

But the problem with the error reporting still exists.

How can I get rid of the errors which really are only warnings?

[Updated on: Wed, 28 September 2011 16:41] by Moderator

Re: Re: CDT-Helios error reporting [message #730782 is a reply to message #730673] Thu, 29 September 2011 03:17 Go to previous messageGo to next message
Eclipse UserFriend
Quote:
Inserting the statement setlocale(..) at the very first line of main() was not successful. But inserting it after QApplication app(argc, argv) was successful. Now fscanf() is working correctly.

You should have mentioned that you are using Qt. I had encountered the same localization problem there (I never heard of localized sscanf before). Here is the comment from the Qt source code.
On Unix/Linux Qt is configured to use the system locale settings by default. This can cause a conflict when using POSIX functions, for instance, when converting between data types such as floats and strings, since the notation may differ between locales. To get around this problem, call the POSIX function setlocale(LC_NUMERIC,"C")


Quote:
But the problem with the error reporting still exists.
How can I get rid of the errors which really are only warnings?

Just to be clear: The build console (the actual compiler output) shows warnings and the Problems view shows them as errors? Is the compiler output in English or also localized? Eclipse error parser knows nothing about localization. It expects compiler errors/warnings in English. You can change the regexp for the error parser (see General->Preferences->C/C++->Build->Settings). But I would not advise (it is must easier to search the internet for English error messages!). I recommend adding an environment variable in General->Preferences->C/C++->Build->Environment with the name "LC_ALL" and the value "en_GB.UTF-8" (that's what I do).

[Updated on: Thu, 29 September 2011 03:23] by Moderator

Re: Re: CDT-Helios error reporting [message #731520 is a reply to message #730782] Sat, 01 October 2011 11:10 Go to previous messageGo to next message
Eclipse UserFriend
Quote:
Just to be clear: The build console (the actual compiler output) shows warnings and the Problems view shows them as errors?

Yes, that is the problem.

Quote:
Is the compiler output in English or also localized?

There is a mixture, e.g.
make debug 
make -f Makefile.Debug
make[1]: Entering directory `/mnt/e_drive/Backup/IPC_Simulation'
make[1]: Warning: File `simu_cfunc/simu_matching_utility.c' has modification time 2,5 s in the future
...
operat_cfunc/include/error.h:587:34: Warnung: »ec_string_map« definiert, aber nicht verwendet
...

The line with German text is displayed in the Problems view as
Errors (3 items)
    Warnung: »ec_string_map« definiert, aber nicht verwendet ...
    ...


Quote:
I recommend adding an environment variable in General->Preferences->C/C++->Build->Environment with the name "LC_ALL" and the value "en_GB.UTF-8" (that's what I do).

I added this environment variable, but with no effect, i.e. the warnings are still reported as errors and the text is still in German.
In my old configuration with openSuse10.3 and Eclipse Galileo this problem did not occur.

Now I got 3 questions:
1. Is it possible to install Galileo and Helios in parallel, just for testing if the problem comes from the openSuse or the Virtual machine?

2. Are there any problems reported running openSuse and Eclipse on a Virtual machine?

3. There is something irregular with my clock on the new PC.
The fourth line in the compiler console output above tells me that the modification time of a file is
in the future. The compiler messages end with a corresponding text:
make[1]: Warnung: Mit der Uhr stimmt etwas nicht. 
make[1]: Leaving directory `/mnt/e_drive/Backup/IPC_Simulation'
Die Bearbeitung könnte unvollständig sein.

Is it possible that this could be the reason for the problems?
Re: Re: CDT-Helios error reporting [message #732187 is a reply to message #731520] Tue, 04 October 2011 03:44 Go to previous messageGo to next message
Eclipse UserFriend
Quote:
operat_cfunc/include/error.h:587:34: Warnung: »ec_string_map« definiert, aber nicht verwendet
...

The line with German text is displayed in the Problems view as
Errors (3 items)
Warnung: »ec_string_map« definiert, aber nicht verwendet ...
...

The error parser look for the string "error" (your file is named error.h!). So it is definitely a problem of the parser.

Quote:
I added this environment variable, but with no effect, i.e. the warnings are still reported as errors and the text is still in German.

Did you add it correctly? Does the variable show up when you open Project Properties->C/C++Build->Environment?

Quote:
1. Is it possible to install Galileo and Helios in parallel, just for testing if the problem comes from the openSuse or the Virtual machine?

That is possible but it won't help you. Helios has the same error parser. You have to change the locale to English.

Quote:
3. There is something irregular with my clock on the new PC.

Sounds like a setup problem of your virtual machine. It should sync its clock with the host system.
Re: Re: CDT-Helios error reporting [message #733477 is a reply to message #732187] Tue, 04 October 2011 16:44 Go to previous messageGo to next message
Eclipse UserFriend
Quote:
Did you add it correctly? Does the variable show up when you open Project Properties->C/C++Build->Environment?

Yes, it shows up, see the attached image.

Would it help to install openSuse11.3 in English instead of German?
(it's a big issue to reinstall it)
Re: Re: CDT-Helios error reporting [message #733582 is a reply to message #733477] Wed, 05 October 2011 02:44 Go to previous messageGo to next message
Eclipse UserFriend
Nick Schweyer wrote on Tue, 04 October 2011 22:44
Quote:
Did you add it correctly? Does the variable show up when you open Project Properties->C/C++Build->Environment?

Yes, it shows up, see the attached image.

That's the global Preferences page (OK, you entered it correctly). I was asking about Project Properties->C/C++Build->Environment of your project.


Quote:
Would it help to install openSuse11.3 in English instead of German?
(it's a big issue to reinstall it)

If it still does not work (but I don't know why because I have the same setup here) then I would create a small shell script to start Eclipse.

#!/bin/bash
# english gcc output (do not confuse eclipse error parser!)
export LC_ALL=en_GB.UTF-8

/PATH/TO/ECLIPSE/eclipse &

exit 1


solved: Re: Re: CDT-Helios error reporting [message #733863 is a reply to message #733582] Wed, 05 October 2011 16:02 Go to previous message
Eclipse UserFriend
Thank you very much. Now Eclipse behaves as I like it Smile
In my Eclipse configuration the location for the LC_ALL variable is C/C++ Make Project / Environment.

[Updated on: Wed, 05 October 2011 16:12] by Moderator

Previous Topic:DSF-GDB Mingw: console freezes + unable to pause
Next Topic:AM_SILENT_RULES and the indexer
Goto Forum:
  


Current Time: Wed Jul 09 15:58:47 EDT 2025

Powered by FUDForum. Page generated in 0.07664 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top