gnupg-2.2.14: Compilation failure on OpenIndiana
Closed, ResolvedPublic

Description

dns.c:5278:73: error: expected identifier or ‘(’ before numeric constant

union { unsigned char b[dns_p_calcsize((512))]; struct dns_packet p; } _P = { 0 };
                                                                       ^~

dns.c:5279:39: error: request for member ‘p’ in something not a structure or union

struct dns_packet *P = dns_p_init(&_P.p, 512);
                                     ^

In file included from /usr/include/ctype.h:36,

from dns.c:44:

dns.c: In function ‘dns_hints_query’:
dns.c:6840:73: error: expected identifier or ‘(’ before numeric constant

union { unsigned char b[dns_p_calcsize((512))]; struct dns_packet p; } _P = { 0 };
                                                                       ^~

dns.c:6861:22: error: request for member ‘p’ in something not a structure or union

P   = dns_p_init(&_P.p, 512);
                    ^

...
(there's more occurrences of this pattern in the same file)

renaming _P to something like _GTLSP makes compilation succeed.

I believe this problem also exists on Solaris 10 (and 11).

Related Objects

grobian created this task.Mar 22 2019, 9:17 PM
werner triaged this task as High priority.Mar 24 2019, 10:48 AM
werner added projects: gnupg (gpg22), Solaris.
werner added a subscriber: werner.

Thanks for the report. underscore followed by an uppercase letter is actually reserved for the system; thus we should not have used that.

gniibe claimed this task.Mar 25 2019, 11:16 AM
werner changed the task status from Open to Testing.Mar 25 2019, 2:51 PM

We fixed that in master and 2.2. Can you please test this with the next release and report or close this bug?

grobian closed this task as Resolved.Mar 25 2019, 3:07 PM

I applied https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=patch;h=8d1b5982138c104f3c50663738892fa110193059 on top of 2.2.14.

Compilation succeed with this patch.

Thanks!