Nicolas,

On Wednesday 11 July 2007 11:53, Nicolas TOUCHARD wrote:
> >> The most strange is when it's working with static global structure, if I
> >> pass it to non static , it's not working !!
> >
> > ? "pass to no static"?
>
> no problem with "static T_SYTGEOBusManager tSytgeoBus;"
> but memory problem with "T_SYTGEOBusManager tSytgeoBus;"

All right, its unitialised common variable. Do you are using anywhere else in 
your sources a variable also called "tSytgeoBus" with a different size?

For global common variables the linker combines them into one variable.

So:

source1.c
 [...]
  int var;
 [...]

source2.c
 [...]
 char var;
 [...]

source3.c
 [...]
 long var;
 [...]

...all different "var" will be combined into one variable "var" by the linker. 
Try to add the "--warn-common" parameter to your linker. This will help to 
find such an failure.

Hope it helps

Juergen

-- 
Dipl.-Ing. Juergen Beisert | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
    Handelsregister: Amtsgericht Hildesheim, HRA 2686
         Vertretung Sued/Muenchen, Germany
   Phone: +49-8766-939 228 |  Fax: +49-5121-206917-9

-- 
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to