Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
66 user(s) are online (58 user(s) are browsing Forums)

Members: 1
Guests: 65

cobale, more...

Support us!

Headlines




« 1 ... 5 6 7 (8)


Re: gcc 9 and 10
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1325
@walkero

Probably adding "extern" in global.h will help, and then defining those symbols in one C file only.

   Report Go to top

Re: gcc 9 and 10
Just popping in
Joined:
2011/7/20 20:01
From In the sticks
Posts: 172
If you have a globals header file you can have something like

#ifndef DOXYGEN_SHOULD_SKIP_THIS

#ifdef ALLOCATE_GLOBALS
    #define GLOBAL_PREFIX 
    #define GLOBAL_VAL(x)    = x
#else
    #define GLOBAL_PREFIX extern
    #define GLOBAL_VAL(x)
#endif

#endif         /* #ifndef DOXYGEN_SHOULD_SKIP_THIS */

GLOBAL_PREFIX const char *G_NAME_S GLOBAL_VAL ("name");
GLOBAL_PREFIX int g_log_level GLOBAL_VAL (1);



then in one of the c source files have

#define ALLOCATE_GLOBALS (1)


before the

#include "globals.h"

line in that particular file and it will define and declare the variables just fine

   Report Go to top

Re: gcc 9 and 10
Site Builder
Joined:
2006/12/2 23:57
From Athens/Dublin
Posts: 821
Thanks again for your proposals.
The reason I mentioned this problem in this thread is because I thought that this might be a problem of the GCC 10 itself. Let's don't derail the thread further.

I really appreciate your feedback guys. Thanks again.

   Report Go to top


« 1 ... 5 6 7 (8)



[Advanced Search]



Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project