Skip to contentSkip to conversation

diffutils: set gnu99 C mode

PATCH New Axel Lin 2 participants 3 messages Sep 30, 2013 – Oct 1, 2013

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 diffutils: set gnu99 C mode

---
Fix below build error:

CC dir.o
dir.c: In function 'find_dir_file_pathname':
dir.c:345:8: error: 'for' loop initial declarations are only allowed in C99 mode dir.c:345:8: note: use option -std=c99 or -std=gnu99 to compile your code make[3]: *** [dir.o] Error 1
make[3]: *** Waiting for unfinished jobs....

 package/diffutils/diffutils.mk | 1 +
 1 file changed, 1 insertion(+)
package/diffutils/diffutils.mk +1 -0
index 6934532..38b1ccd 100644
@@ -10,6 +10,7 @@ DIFFUTILS_SITE = $(BR2_GNU_MIRROR)/diffutils
 DIFFUTILS_DEPENDENCIES = $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext)
 DIFFUTILS_LICENSE = GPLv3+
 DIFFUTILS_LICENSE_FILES = COPYING
+DIFFUTILS_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
 
 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 DIFFUTILS_DEPENDENCIES += busybox
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/1 diffutils: set gnu99 C mode

Dear Axel Lin,

Quoted 19 lines · Axel Lin

---
Fix below build error:

CC dir.o
dir.c: In function 'find_dir_file_pathname':
dir.c:345:8: error: 'for' loop initial declarations are only allowed in C99 mode dir.c:345:8: note: use option -std=c99 or -std=gnu99 to compile your code make[3]: *** [dir.o] Error 1
make[3]: *** Waiting for unfinished jobs....

 package/diffutils/diffutils.mk | 1 +
 1 file changed, 1 insertion(+)
package/diffutils/diffutils.mk +0 -0
index 6934532..38b1ccd 100644

package/diffutils/diffutils.mk DIFFUTILS_SITE = $(BR2_GNU_MIRROR)/diffutils · line 16

Quoted 7 lines
package/diffutils/diffutils.mk +1 -0
@@ -10,6 +10,7 @@ DIFFUTILS_SITE = $(BR2_GNU_MIRROR)/diffutils
 DIFFUTILS_DEPENDENCIES = $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext)
 DIFFUTILS_LICENSE = GPLv3+
 DIFFUTILS_LICENSE_FILES = COPYING
+DIFFUTILS_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
 
 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 DIFFUTILS_DEPENDENCIES += busybox

Hum, seems strange that this is needed. I see that the configure.ac of diffutils 3.2 (currently in Buildroot) has AM_PROG_CC_STDC, it has been removed since then. If diffutils uses C99 constructs, then it should be specifying AC_PROG_CC_C99 in its configure.ac, I guess.

Of course, what you propose is a relatively simple workaround, but I believe the real fix is in diffutils itself.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
author
#2 lore raw

PATCH 1/1 diffutils: set gnu99 C mode

2013/10/1 Thomas Petazzoni <[email protected]>:

Quoted 35 lines

Dear Axel Lin,

Quoted 19 lines · Axel Lin

---
Fix below build error:

CC dir.o
dir.c: In function 'find_dir_file_pathname':
dir.c:345:8: error: 'for' loop initial declarations are only allowed in C99 mode dir.c:345:8: note: use option -std=c99 or -std=gnu99 to compile your code make[3]: *** [dir.o] Error 1
make[3]: *** Waiting for unfinished jobs....

 package/diffutils/diffutils.mk | 1 +
 1 file changed, 1 insertion(+)
package/diffutils/diffutils.mk +0 -0
index 6934532..38b1ccd 100644

package/diffutils/diffutils.mk DIFFUTILS_SITE = $(BR2_GNU_MIRROR)/diffutils · line 16

Quoted 7 lines
package/diffutils/diffutils.mk +1 -0
@@ -10,6 +10,7 @@ DIFFUTILS_SITE = $(BR2_GNU_MIRROR)/diffutils
 DIFFUTILS_DEPENDENCIES = $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext)
 DIFFUTILS_LICENSE = GPLv3+
 DIFFUTILS_LICENSE_FILES = COPYING
+DIFFUTILS_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
 
 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 DIFFUTILS_DEPENDENCIES += busybox

Hum, seems strange that this is needed. I see that the configure.ac of diffutils 3.2 (currently in Buildroot) has AM_PROG_CC_STDC, it has been removed since then. If diffutils uses C99 constructs, then it should be specifying AC_PROG_CC_C99 in its configure.ac, I guess.

Quoted 2 lines

Of course, what you propose is a relatively simple workaround, but I believe the real fix is in diffutils itself.

Hi Thomas,
Thanks for the review and please ignore this patch. I have no idea why I cannot reproduce this issue now. I can build diffutils without this patch today.

Regards,
Axel