User forums > General (but related to Code::Blocks)

Build log different to build messages

(1/2) > >>

smallB:
If I set in compiler options compiler logging to full command line and try to compile this (erroneous program):

--- Code: ---#include <iostream>
#include <typeinfo>
#include "Demangle.h"
using namespace std;
template<class... Types>
struct X
{

};

template<class A,class B,class... Types>
struct X<A,B,Types...>
{
    typedef A type;
    typedef X<B,Types...> next;
    A head;

};

//template<class A,class... Types>
//struct X<A,Types...>
//{
//    typedef A type;
//    typedef X<Types...> next;
//    A head;
//
//};

template<class B>
struct X<B>
{
    B head;
    typedef B type;
    typedef B next;
};

template<int index, class Sequence>
struct get
{
        typedef typename get<index - 1,typename Sequence::next>::type type;
};

template<class Sequence>
struct get<0,Sequence>
{
    typedef typename Sequence::type type;
};


int main()
{
    typedef X<int,double,char> x;
    //cout << demangle(x.get_head());
     cout << demangle(typename get<3,x>::type());
    return 0;
}

--- End code ---
, from build messages (inside cb):

--- Code: ---d:\Excersizes\metaprogramming_excersizes\Meta_Sequence\main.cpp|40|  recursively instantiated from 'get<2, X<double, char> >'|
d:\Excersizes\metaprogramming_excersizes\Meta_Sequence\main.cpp:40|71|instantiated from 'get<3, X<int, double, char> >'|
d:\Excersizes\metaprogramming_excersizes\Meta_Sequence\main.cpp:54|40|instantiated from here|
d:\Excersizes\metaprogramming_excersizes\Meta_Sequence\main.cpp|46|error: 'char' is not a class, struct, or union type|
||=== Build finished: 2 errors, 0 warnings (0 minutes, 0 seconds) ===|
--- End code ---
but from log file:

--- Code: ---Build started on: 26-10-2011 at 10:24.35
 Build ended on: 26-10-2011 at 10:24.36

-------------- Build: Debug in Meta_Sequence ---------------
 g++ -Wall -fexceptions -g -Wshadow -Winit-self -Wredundant-decls -Wcast-align -Wundef -Wfloat-equal -Winline -Wunreachable-code -Wmissing-declarations -Wmissing-include-dirs -Wswitch-enum -Wswitch-default -Weffc++ -Wmain -pedantic-errors -pedantic -std=c++0x -Wfatal-errors -Wextra -Wall -g -ID:\Libraries\boost_1_47_0\boost_1_47_0 -ID:\Libraries\Art_lib -Id:\Excersizes\metaprogramming_excersizes\Meta_Sequence -Id:\Excersizes\metaprogramming_excersizes\Meta_Sequence -c d:\Excersizes\metaprogramming_excersizes\Meta_Sequence\main.cpp -o obj\Debug\main.o
 d:\Excersizes\metaprogramming_excersizes\Meta_Sequence\main.cpp: In instantiation of 'get<0, char>':
d:\Excersizes\metaprogramming_excersizes\Meta_Sequence\main.cpp:40:71: recursively instantiated from 'get<2, X >'
 d:\Excersizes\metaprogramming_excersizes\Meta_Sequence\main.cpp:40:71: instantiated from 'get<3, X >'
 d:\Excersizes\metaprogramming_excersizes\Meta_Sequence\main.cpp:54:40: instantiated from here
d:\Excersizes\metaprogramming_excersizes\Meta_Sequence\main.cpp:46:37: error: 'char' is not a class, struct, or union type
 compilation terminated due to -Wfatal-errors.
Process terminated with status 1 (0 minutes, 0 seconds)
2 errors, 0 warnings (0 minutes, 0 seconds)
--- End code ---
things look even worse when I try to open this file internally via cb(in cb's html viewer).

zabzonk:
And your problem is ... what?

smallB:
Hi Neil, my problem is that in build log specializations of 'get' meta function are not listed with their correct types. I think that log should be as detailed as possible, and this isn't.

MortenMacFly:

--- Quote from: smallB on October 26, 2011, 12:00:30 pm ---Hi Neil, my problem is that in build log specializations of 'get' meta function are not listed with their correct types. I think that log should be as detailed as possible, and this isn't.

--- End quote ---
The build log shows everything the compiler tells you. If that is not enough, complain to the GCC guys.

smallB:
Hi Morten,
But in cb I'm getting correct types displayed: get<1,X<int,double>>, this isn't the case in log file: get<1,X>. So who is responsible for that cb or gcc?

Navigation

[0] Message Index

[#] Next page

Go to full version