Automatically initialize all global variables/arrays in GCC.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux