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]

Automatically initialize all global variables/arrays in GCC.


I am using gcc to compile our C code under Linux. After compiling and
linking, we use SWIG to create python wrapper for the C code so that
we can execute C functions in python.

My question is: When our C program gets loaded into python, is it
possible to have all global variables/arrays in our C code to be
initialized to some magic constants (say all ones)? I think if this is
possible, it would be a linker option under GCC. My gcc version is:

gcc version 3.3.5 (Debian 1:3.3.5-12)

I have looked through the online manual for gcc but could not find
anything that is related to my problem. Actually I am not 100% sure
whether this is done by the compiler or SWIG.

Thanks.


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