News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Build log different to build messages

Started by smallB, October 26, 2011, 11:35:24 AM

Previous topic - Next topic

smallB

If I set in compiler options compiler logging to full command line and try to compile this (erroneous program):
#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):
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:
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


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.
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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

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?

Jenna

Quote from: MortenMacFly on October 26, 2011, 01:12:41 PM
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.
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.

smallB

Thanks jens, for a moment I thought I'm going crazy and only I can see that something isn't right.