[PATCH] Alternative patch for compiler error (was: [PATCH] Workaround compile error on networking/libiproute/iplink.c)

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Thu Jul 25 16:29:48 UTC 2013


Ping!

On Mon, 22 Jul 2013, Cristian Ionescu-Idbohrn wrote:
>
> IFLA_VLAN_PROTOCOL define was introduced with commit
> a7ecbed56bb620a0e8cd79372886d0fdfeb362c8.  gcc 4.8.1 complains.
>
>   CC      networking/libiproute/iplink.o
> networking/libiproute/iplink.c:26:33: error: expected identifier before numeric constant
>  #define IFLA_VLAN_PROTOCOL      5
>                                  ^
> make[1]: *** [networking/libiproute/iplink.o] Error 1

Does noone else see it?  Is it only me?
I'm not C-literate but, IFLA_VLAN_PROTOCOL comes with:

	#include "ip_common.h"

which:

	#include <linux/if_link.h>

which:

	/* VLAN section */

	enum {
		IFLA_VLAN_UNSPEC,
		IFLA_VLAN_ID,
		IFLA_VLAN_FLAGS,
		IFLA_VLAN_EGRESS_QOS,
		IFLA_VLAN_INGRESS_QOS,
		IFLA_VLAN_PROTOCOL,
		__IFLA_VLAN_MAX,
	};

Shouldn't:

	#undef  IFLA_VLAN_PROTOCOL
	#define IFLA_VLAN_PROTOCOL      5

come after that?

networking/libiproute/iplink.c:25:33: error: expected identifier before numeric constant
 #define IFLA_VLAN_PROTOCOL      5
                                 ^
make[1]: *** [networking/libiproute/iplink.o] Error 1

Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn at axis.com>
---
 networking/libiproute/iplink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c
index 45cad71..583d704 100644
--- a/networking/libiproute/iplink.c
+++ b/networking/libiproute/iplink.c
@@ -9,6 +9,7 @@
 #include <net/if_packet.h>
 #include <netpacket/packet.h>
 #include <netinet/if_ether.h>
+#include "ip_common.h"  /* #include "libbb.h" is inside */

 #include <linux/if_vlan.h>
 #undef  ETH_P_8021AD
@@ -24,7 +25,6 @@
 #undef  IFLA_VLAN_PROTOCOL
 #define IFLA_VLAN_PROTOCOL      5

-#include "ip_common.h"  /* #include "libbb.h" is inside */
 #include "rt_names.h"
 #include "utils.h"

-- 
1.8.3.2


Cheers,

-- 
Cristian


More information about the busybox mailing list