Re: Order of variables in specific sections when enabling optimization in gcc

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

 



On 03/07/2019 01:16 PM, Freddie Chopin wrote:
> No worries, it won't optimize them away, there's also a header where
> these variables are declared with `extern ...` (omitted that in the
> example, as this doesn't change anything) and all of them will be used
> in the project. I'm just concerned about their order.

Just put them into a structure. If you need to maintain the old names,
you can always use #define.

struct {
	int a;
	int b;
	int c;
} globals;

#define a	global.a
#define b	global.b
#define c	global.c

regards, Matthias

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[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