This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Qeustion about the optimize option


I want to build the linux kernel at O0 optimize level. The first problem
that I face was something about constant.
I have study it for a day time, but it haven't sovled.
There is the problem.

#include <stdio.h>

int main()
{
        int *map;
        const size_t size = 128 * sizeof(map[0]);

        ((void)(sizeof(struct { int:-!!(size > ((1UL) << 12)); })));
}

When I compile this program use gcc test.c, it fail with
test.c: In function âmainâ:
test.c:8:24: error: bit-field â<anonymous>â width not an integer
constant

When I compile this program use gcc test.c -O, it success.

Because I want to debug the linux kernel, how can compile the test
program above don't use O1 O2 O3.

Thanks.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]