Code::Blocks Forums

User forums => Help => Topic started by: smallB on June 06, 2012, 06:18:59 pm

Title: Error isn't listed in a log
Post by: smallB on June 06, 2012, 06:18:59 pm
Guys, while compiling this class:

I'm getting following log:
Code
template<class T, int Min, int Max>
    class Range
    {
        const T min_ = Min;
        T max_ = Max;
    
    };

Build started on: 06-06-2012 at 16:56.21
Build ended on: 06-06-2012 at 16:56.24
-------------- Build: Debug in SafeInt (compiler: gcc 4.7 STL)---------------
g++.exe -Wall -fexceptions -g -std=c++0x -IC:\SFML-1.6\include -c "C:\Users\Art\Documents\code blocks\SafeInt\SafeInt\main.cpp" -o obj\Debug\main.o
In file included from C:\Users\Art\Documents\code blocks\SafeInt\SafeInt\Range_implementation.hpp:4:0,
from C:\Users\Art\Documents\code blocks\SafeInt\SafeInt\Range.hpp:3,
from C:\Users\Art\Documents\code blocks\SafeInt\SafeInt\SafeInt_interface.hpp:3,
from C:\Users\Art\Documents\code blocks\SafeInt\SafeInt\SafeInt_implementation.hpp:3,
from C:\Users\Art\Documents\code blocks\SafeInt\SafeInt\SafeInt.hpp:4,
from C:\Users\Art\Documents\code blocks\SafeInt\SafeInt\main.cpp:3:
C:\Users\Art\Documents\code blocks\SafeInt\SafeInt\Range_interface.hpp: In instantiation of 'class Range<char, -128ll, -127ll>':
C:\Users\Art\Documents\code blocks\SafeInt\SafeInt\main.cpp:10:27: required from here
C:\Users\Art\Documents\code blocks\SafeInt\SafeInt\Range_interface.hpp:23:20: warning: non-static const member 'const char Range<char, -128ll, -127ll>::min_' in class without a constructor [-Wuninitialized]
C:\Users\Art\Documents\code blocks\SafeInt\SafeInt\main.cpp: In function 'int main()':
C:\Users\Art\Documents\code blocks\SafeInt\SafeInt\main.cpp:14:15: warning: overflow in implicit constant conversion [-Woverflow]
C:\Users\Art\Documents\code blocks\SafeInt\SafeInt\main.cpp:8:22: warning: unused variable 'min' [-Wunused-variable]
C:\Users\Art\Documents\code blocks\SafeInt\SafeInt\main.cpp:9:22: warning: unused variable 'max' [-Wunused-variable]
g++.exe -LC:\SFML-1.6\lib -o bin\Debug\SafeInt.exe obj\Debug\main.o C:\SFML-1.6\lib\libsfml-audio.a C:\SFML-1.6\lib\libsfml-audio-d.a C:\SFML-1.6\lib\libsfml-audio-s.a C:\SFML-1.6\lib\libsfml-audio-s-d.a C:\SFML-1.6\lib\libsfml-graphics.a C:\SFML-1.6\lib\libsfml-graphics-d.a C:\SFML-1.6\lib\libsfml-graphics-s.a C:\SFML-1.6\lib\libsfml-graphics-s-d.a C:\SFML-1.6\lib\libsfml-main.a C:\SFML-1.6\lib\libsfml-main-d.a C:\SFML-1.6\lib\libsfml-network.a C:\SFML-1.6\lib\libsfml-network-d.a C:\SFML-1.6\lib\libsfml-network-s.a C:\SFML-1.6\lib\libsfml-network-s-d.a C:\SFML-1.6\lib\libsfml-system.a C:\SFML-1.6\lib\libsfml-system-d.a C:\SFML-1.6\lib\libsfml-system-s.a C:\SFML-1.6\lib\libsfml-system-s-d.a C:\SFML-1.6\lib\libsfml-window.a C:\SFML-1.6\lib\libsfml-window-d.a C:\SFML-1.6\lib\libsfml-window-s.a C:\SFML-1.6\lib\libsfml-window-s-d.a
Output size is 1.31 MB
Process terminated with status 0 (0 minutes, 2 seconds)
1 errors, 4 warnings (0 minutes, 2 seconds)

As you see here one error is listed but this error isn't shown in a log. Any  thoughts?
Title: Re: Error isn't listed in a log
Post by: zabzonk on June 06, 2012, 06:46:48 pm
I think this may be a GCC bug (or feature). The message I get with 4.6.1 is;

Code
err.cpp:4:24: sorry, unimplemented: non-static data member initializers

which as you can see isn't really a proper GCC error message - if it were, it would look like:

Code
err.cpp:4:24: error: unimplemented non-static data member initializers
Title: Re: Error isn't listed in a log
Post by: oBFusCATed on June 06, 2012, 07:14:18 pm
Code
C:\Users\Art\Documents\code blocks\SafeInt\SafeInt\main.cpp:10:27: required from here
This is the problem and this happens because gcc 4.7 is not fully supported.
And I don't know what is your version of course.

Search the forum, there were some discussions about it....
Title: Re: Error isn't listed in a log
Post by: smallB on June 07, 2012, 07:58:26 am
After spending some time, I've discovered that if I unchecked Wall in codeblocks it compiles fine. This is weird.