Author Topic: Build log different to build messages  (Read 4657 times)

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Build log different to build messages
« on: October 26, 2011, 11:35:24 am »
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;
}
, 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) ===|
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)
things look even worse when I try to open this file internally via cb(in cb's html viewer).


zabzonk

  • Guest
Re: Build log different to build messages
« Reply #1 on: October 26, 2011, 11:39:07 am »
And your problem is ... what?

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Build log different to build messages
« Reply #2 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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Build log different to build messages
« Reply #3 on: October 26, 2011, 01:12:41 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.
The build log shows everything the compiler tells you. If that is not enough, complain to the GCC guys.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Build log different to build messages
« Reply #4 on: October 26, 2011, 01:26:33 pm »
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?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Build log different to build messages
« Reply #5 on: October 26, 2011, 01:29:02 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.
The build log shows everything the compiler tells you. If that is not enough, complain to the GCC guys.
I can confirm this issue.
The HTML buildlog is not shown correctly in a browser, because if a "<" is followed by a character it will be treated as HTML-tag, even if it is not correct and is therefore not shown.
In his case, it's the "<double, char>" and the "<int, double, char>" part.

I just committed a fix for it.

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Build log different to build messages
« Reply #6 on: October 26, 2011, 02:25:29 pm »
Thanks jens, for a moment I thought I'm going crazy and only I can see that something isn't right.