1 msgproblems with gfortran
3 msginternal compiler error
10 msgbinary compiled with -O1 and w/ individual opti...
1 msgStatic stack usage analysis for c/c++
2 msggcj (gcc-4.3.0-RC-20080222): compiling for ARM-...
4 msghow to build interference graph in gcc

const issues
\ Jason Pepas (29 Feb 2008)
. \ Dario Saccavino (29 Feb 2008)
. . \ Jason Pepas (29 Feb 2008)

1 msgLinking to a static library compiled with a dif...
4 msgHow to create a 'finish' function for a tree op...
1 msginvalid pointer
3 msgProblem going to GCC from ICC
2 msgra-build.c
2 msgHow to rebuild GCC?
2 msghow to use testsuite to check vectorization cap...
12 msgGCC 3.3 binary for XScale
2 msgThumb->ARM->Thumb in inline-wrapped asm?
4 msgAligning function on a page boundary
1 msgdenormalized number problem under AIX
1 msgQuestion about DECL_UID of struct field
5 msgOptimizations and the -pedantic option
Subject:const issues
Group:Gcc-help
From:Jason Pepas
Date:29 Feb 2008


this compiles as expected:


#include <stdlib.h>

int main()
{
const int a = 42;
const int * const b = &a;
const int * const c = b;

return EXIT_SUCCESS;
}


but moving the variables outside of the function causes gcc to die
with "error: initializer element is not constant" on line 5 (the "c =
b" line):


#include <stdlib.h>

const int a = 42;
const int * const b = &a;
const int * const c = b;

int main()
{
return EXIT_SUCCESS;
}


As best as I can tell, the error is a lie: I can't make that any more
const than it already is.

ideas?

-jason pepas


© 2004-2008 readlist.com