pan-users
[Top][All Lists]
Advanced

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

Re: [Pan-users] Latest HOTFIX commit fails to compile


From: Zan Lynx
Subject: Re: [Pan-users] Latest HOTFIX commit fails to compile
Date: Wed, 16 Jan 2013 11:22:28 -0700

On Sun, 2013-01-13 at 11:28 +0100, Heinrich Müller wrote:

> > Any idea why the compiler is complaining about locking.h?
> the "static" is there because then the mutex is initialized. It could 
> lead to erroneous behaviour
> if you just deleted it.
> I'll supply a fix for that.

I haven't looked at this code but this comment raised big alarm flags
for me.

Using "static" on a global variable in a .h file can result in
independent unlinked copies in each .c or .cpp file that uses it.
"static" at file scope means that variable exists only for that one
file.

Doing this for a mutex may mean that locks in different source files are
not communicating with each other.

To properly do a global variable, it should be declared as "extern" in
the .h files and defined with an initializer in one single .c/.cpp file.
-- 
Knowledge Is Power
Power Corrupts
Study Hard
Be Evil




reply via email to

[Prev in Thread] Current Thread [Next in Thread]