New coding style and layout.gadget

3 posts / 0 new
Last post
whose
whose's picture
Offline
Last seen: 6 years 4 months ago
Joined: 2011-08-09 02:25
New coding style and layout.gadget

Hi!

I tried the new ReAction coding style using the Class pointers of every GUI thingie I want to use. Doing this, I experienced a very strange thing. Its not possible to add more layouts to the root layout!

Edit: Ok, got it. "done" was initialized differently by gcc, when there was code added. Im used to compilers with a defined initializing behaviour ;) If "done" is initialized explicitely, the code works as expected.

salass00
salass00's picture
Offline
Last seen: 1 year 1 month ago
Joined: 2011-02-03 11:27
Just so you know, local

Just so you know, local non-static variables (i.e. ones that are allocated from the stack) are never initialised implicitly and unless explicitly initialised will start with whatever value that happened to be in that memory location at the time of their creation. This behavior is in the C standard and not in any way specific to gcc. When compiling with gcc you should always have warnings enabled (-Wall option) as then it will more often than not tell you about these kinds of problems in your code.

whose
whose's picture
Offline
Last seen: 6 years 4 months ago
Joined: 2011-08-09 02:25
Well, actually it doesnt warn

Well, actually it doesnt warn about this kind of odds-in-code at all, otherwise I would have seen it in the beginning ;)

Nonetheless, I will remember this for the future ;)

Coder Insane-Software

www.insane-software.de

Log in or register to post comments