missing extern in GraphicsBase.h

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

missing extern in GraphicsBase.h

dmitrii.pasechnik
Dear all,
in src/include/GraphicsBase.h one has a declaration

int baseRegisterIndex;

the same as in src/main/devices.c

which causes problems on Solaris, see bug #17385,
and other platforms with "unusual" linkers, see bug #16633.

By right, global variables like baseRegisterIndex are to be
declared just once, and not in a header file, but in a *.c file.
Then, to use them elsewhere in the code, one declares them as
extern in the header.
(as proposed on #17385)

Otherwise one has an undefined behaviour,
some linkers might silently prepend extern, some not...

May I humbly request attention to this bug
(which is classified as UNCONFIRNMED---and indeed it needs an extra
effort to reproduce the error on, say, Linux --- but it really is an obvious C
bug, which will rear its ugly head sooner or later again)

Thanks,
Dmitrii


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: missing extern in GraphicsBase.h

Paul Murrell-2
Hi

I have committed the suggested "extern" patch.

Could you please confirm that this fixes the issue on Solaris (and
anything else you can test) ?

Thanks!

Paul

On 16/02/18 03:39, [hidden email] wrote:

> Dear all,
> in src/include/GraphicsBase.h one has a declaration
>
> int baseRegisterIndex;
>
> the same as in src/main/devices.c
>
> which causes problems on Solaris, see bug #17385,
> and other platforms with "unusual" linkers, see bug #16633.
>
> By right, global variables like baseRegisterIndex are to be
> declared just once, and not in a header file, but in a *.c file.
> Then, to use them elsewhere in the code, one declares them as
> extern in the header.
> (as proposed on #17385)
>
> Otherwise one has an undefined behaviour,
> some linkers might silently prepend extern, some not...
>
> May I humbly request attention to this bug
> (which is classified as UNCONFIRNMED---and indeed it needs an extra
> effort to reproduce the error on, say, Linux --- but it really is an obvious C
> bug, which will rear its ugly head sooner or later again)
>
> Thanks,
> Dmitrii
>
>
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
[hidden email]
http://www.stat.auckland.ac.nz/~paul/

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel