Skip to contentSkip to conversation

Fix build with gcc 10

PATCH In review [email protected] 2 participants 3 messages Nov 20, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix build with gcc 10

Add a missing typedef in front of the pseudo_access_t definition. Otherwise pseudo_access_t ends up being a global enum, defined each time pseudo_ipc.h is included.

This fixes the following link time error with gcc 10:

multiple definition of `pseudo_access_t'

---
 pseudo_ipc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
pseudo_ipc.h +1 -1
index caeae5c..d945257 100644
@@ -29,7 +29,7 @@ typedef struct {
 	char path[];
 } pseudo_msg_t;
 
-enum {
+typedef enum {
 	PSA_EXEC = 1,
 	PSA_WRITE = (PSA_EXEC << 1),
 	PSA_READ = (PSA_WRITE << 1),
Signature · 1 line
2.29.2
#1 lore raw
Quoted 20 lines · Vincent Stehlé

Add a missing typedef in front of the pseudo_access_t definition. Otherwise
pseudo_access_t ends up being a global enum, defined each time pseudo_ipc.h
is included.

This fixes the following link time error with gcc 10:

multiple definition of `pseudo_access_t'

---
 pseudo_ipc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
pseudo_ipc.h +0 -0
index caeae5c..d945257 100644

pseudo_ipc.h typedef struct { · line 35

Quoted 8 lines
pseudo_ipc.h +1 -1
@@ -29,7 +29,7 @@ typedef struct {
 	char path[];
 } pseudo_msg_t;
 
-enum {
+typedef enum {
 	PSA_EXEC = 1,
 	PSA_WRITE = (PSA_EXEC << 1),
 	PSA_READ = (PSA_WRITE << 1),

I think we already have this in the pseudo branch we use for OE?

http://git.yoctoproject.org/cgit.cgi/pseudo/commit/pseudo_ipc.h?h=oe-core&id=a44361b8d3fbf5fc40cd87b599caeb380454efbe

Cheers,

Richard

#2 lore raw
Quoted 1 line · Richard Purdie

I think we already have this in the pseudo branch we use for OE?

Hi Richard,

This is correct. I was looking at the master branch. Sorry for the noise.

Best regards,
Vincent.