Discussion:
[PATCH] gdbus: move typedefs for interwork with strict compilers
(too old to reply)
Grant Erickson
2015-10-21 06:44:36 UTC
Permalink
Move enumeration type defintions AFTER the enumerations themselves are declared
and defined such that the header works with strict compilers.
---
gdbus/gdbus.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
index d99c254..7a6a18f 100644
--- a/gdbus/gdbus.h
+++ b/gdbus/gdbus.h
@@ -31,10 +31,6 @@ extern "C" {
#include <dbus/dbus.h>
#include <glib.h>

-typedef enum GDBusMethodFlags GDBusMethodFlags;
-typedef enum GDBusSignalFlags GDBusSignalFlags;
-typedef enum GDBusPropertyFlags GDBusPropertyFlags;
-typedef enum GDBusSecurityFlags GDBusSecurityFlags;

typedef struct GDBusArgInfo GDBusArgInfo;
typedef struct GDBusMethodTable GDBusMethodTable;
@@ -115,6 +111,11 @@ enum GDBusSecurityFlags {
G_DBUS_SECURITY_FLAG_ALLOW_INTERACTION = (1 << 2),
};

+typedef enum GDBusMethodFlags GDBusMethodFlags;
+typedef enum GDBusSignalFlags GDBusSignalFlags;
+typedef enum GDBusPropertyFlags GDBusPropertyFlags;
+typedef enum GDBusSecurityFlags GDBusSecurityFlags;
+
struct GDBusArgInfo {
const char *name;
const char *signature;
--
2.3.5
Patrik Flykt
2015-10-21 10:05:00 UTC
Permalink
Post by Grant Erickson
Move enumeration type defintions AFTER the enumerations themselves are declared
and defined such that the header works with strict compilers.
Applied, thanks!

Patrik
Marcel Holtmann
2015-10-21 10:35:48 UTC
Permalink
Hi Grant,
Post by Grant Erickson
Move enumeration type defintions AFTER the enumerations themselves are declared
and defined such that the header works with strict compilers.
---
gdbus/gdbus.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
index d99c254..7a6a18f 100644
--- a/gdbus/gdbus.h
+++ b/gdbus/gdbus.h
@@ -31,10 +31,6 @@ extern "C" {
#include <dbus/dbus.h>
#include <glib.h>
-typedef enum GDBusMethodFlags GDBusMethodFlags;
-typedef enum GDBusSignalFlags GDBusSignalFlags;
-typedef enum GDBusPropertyFlags GDBusPropertyFlags;
-typedef enum GDBusSecurityFlags GDBusSecurityFlags;
typedef struct GDBusArgInfo GDBusArgInfo;
typedef struct GDBusMethodTable GDBusMethodTable;
@@ -115,6 +111,11 @@ enum GDBusSecurityFlags {
G_DBUS_SECURITY_FLAG_ALLOW_INTERACTION = (1 << 2),
};
+typedef enum GDBusMethodFlags GDBusMethodFlags;
+typedef enum GDBusSignalFlags GDBusSignalFlags;
+typedef enum GDBusPropertyFlags GDBusPropertyFlags;
+typedef enum GDBusSecurityFlags GDBusSecurityFlags;
+
which compiler is this? This code has been in there for a long time and in multiple projects. I have not seen any problems with it.

Regards

Marcel
Grant Erickson
2015-10-21 16:09:03 UTC
Permalink
Subject: Re: [PATCH] gdbus: move typedefs for interwork with strict compilers
Date: October 21, 2015 at 3:35:48 AM PDT
Hi Grant,
Post by Grant Erickson
Move enumeration type defintions AFTER the enumerations themselves are declared
and defined such that the header works with strict compilers.
which compiler is this? This code has been in there for a long time and in multiple projects. I have not seen any problems with it.
Marcel,

This occurs when building a plugin, compiled with C++, and occurs on all of:

arm-none-linux-gnueabi-g++ (Sourcery G++ Lite 2010q1-202) 4.4.1
arm-poky-linux-gnueabi-g++ (GCC) 4.8.2
g++ (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4

Best,

Grant

Loading...