This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Qeustion about the optimize option
- From: Victor <vic7tor at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 10 May 2011 14:45:09 +0800
- Subject: 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.