View Issue Details

IDProjectCategoryView StatusLast Update
0005751ardourbugspublic2013-10-26 15:17
Reporternolaiz Assigned Tox42  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionfixed 
Summary0005751: flag for c++11 is not -std=c++11 but -std=c++0x here (linux, gcc 4.6.4)
Descriptionlibs/plugins/reasonablesynth.lv2/lv2.c fails to compile without c++11 (see additional information), and using --cxx11 fails because the flag in my setup should be -std=c++0x instead of -std=c++11

The attached patch works here, but probably a conditional would be needed on wscript depending on the architecture/build environment.

Additional Information
In file included from ../libs/plugins/reasonablesynth.lv2/lv2.c:28:0:
/usr/include/lv2/lv2plug.in/ns/ext/atom/util.h: In function ‘lv2_atom_object_query’:
/usr/include/lv2/lv2plug.in/ns/ext/atom/util.h:284:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
/usr/include/lv2/lv2plug.in/ns/ext/atom/util.h:284:2: note: use option -std=c99 or -std=gnu99 to compile your code
/usr/include/lv2/lv2plug.in/ns/ext/atom/util.h:288:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
/usr/include/lv2/lv2plug.in/ns/ext/atom/util.h:289:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
/usr/include/lv2/lv2plug.in/ns/ext/atom/util.h: In function ‘lv2_atom_object_body_get’:
/usr/include/lv2/lv2plug.in/ns/ext/atom/util.h:321:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
/usr/include/lv2/lv2plug.in/ns/ext/atom/util.h:323:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
/usr/include/lv2/lv2plug.in/ns/ext/atom/util.h: In function ‘lv2_atom_object_get’:
/usr/include/lv2/lv2plug.in/ns/ext/atom/util.h:374:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
/usr/include/lv2/lv2plug.in/ns/ext/atom/util.h:376:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
In file included from ../libs/plugins/reasonablesynth.lv2/lv2.c:41:0:
../libs/plugins/reasonablesynth.lv2/rsynth.c: In function ‘synthesize_sineP’:
../libs/plugins/reasonablesynth.lv2/rsynth.c:180:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
../libs/plugins/reasonablesynth.lv2/rsynth.c: In function ‘synth_fragment’:
../libs/plugins/reasonablesynth.lv2/rsynth.c:276:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
../libs/plugins/reasonablesynth.lv2/rsynth.c:277:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
../libs/plugins/reasonablesynth.lv2/rsynth.c:289:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
../libs/plugins/reasonablesynth.lv2/rsynth.c: In function ‘synth_reset_channel’:
../libs/plugins/reasonablesynth.lv2/rsynth.c:299:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
../libs/plugins/reasonablesynth.lv2/rsynth.c: In function ‘synth_reset’:
../libs/plugins/reasonablesynth.lv2/rsynth.c:310:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
../libs/plugins/reasonablesynth.lv2/rsynth.c: In function ‘synth_init’:
../libs/plugins/reasonablesynth.lv2/rsynth.c:457:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
../libs/plugins/reasonablesynth.lv2/rsynth.c:464:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
TagsNo tags attached.

Relationships

related to 0005752 new --cxx11 configuration flag broken for GCC<4.7 

Activities

2013-10-26 13:51

 

c++0x.patch (613 bytes)   
diff --git a/wscript b/wscript
index 3d01632..7b22869 100644
--- a/wscript
+++ b/wscript
@@ -114,8 +114,8 @@ def set_compiler_flags (conf,opt):
     is_clang = conf.env['CXX'][0].endswith('clang++')
     
     if conf.options.cxx11:
-        conf.check_cxx(cxxflags=["-std=c++11"])
-        conf.env.append_unique('CXXFLAGS', ['-std=c++11'])
+        conf.check_cxx(cxxflags=["-std=c++0x"])
+        conf.env.append_unique('CXXFLAGS', ['-std=c++0x'])
         if platform == "darwin":
             conf.env.append_unique('CXXFLAGS', ['-stdlib=libc++'])
             conf.env.append_unique('LINKFLAGS', ['-lc++'])
c++0x.patch (613 bytes)   

nolaiz

2013-10-26 13:56

reporter   ~0015459

Sorry there are two different bugs here.

* c++0x configuration failure, which is solved here using the attached patch.

* broken rsynth.c compilation when using c99. I'll try to check this later.

x42

2013-10-26 14:54

administrator   ~0015460

resolved in 3.5-46-ge451411 by simply removing all c99 code :)

please confirm and close the issue.

nolaiz

2013-10-26 15:09

reporter   ~0015461

Confirmed that the configuration works without --cxx11

Thanks!

Anyway as I wrote there were two bugs involved here. The pending one is the broken --cxx11 compilation:

    Checking for compiler flags ['-std=c++11'] : no
    The configuration failed

Changing "-std=c++11" for "-std=c++0x" works here (Gentoo Linux GCC 4.6.4)

x42

2013-10-26 15:16

administrator   ~0015462

The code is question was C99, not C++11. It's not even C++ but plain c.

Adding a c++ option for the c compiler is not the way to resolve things.
waf used 'autowaf.set_c99_mode(conf)' which worked on many machines so far.
I'll blame this one one gentoo :)

Issue History

Date Modified Username Field Change
2013-10-26 13:51 nolaiz New Issue
2013-10-26 13:51 nolaiz File Added: c++0x.patch
2013-10-26 13:56 nolaiz Note Added: 0015459
2013-10-26 14:54 x42 Note Added: 0015460
2013-10-26 14:54 x42 Status new => resolved
2013-10-26 14:54 x42 Resolution open => fixed
2013-10-26 14:54 x42 Assigned To => x42
2013-10-26 15:09 nolaiz Note Added: 0015461
2013-10-26 15:16 x42 Note Added: 0015462
2013-10-26 15:17 x42 Status resolved => closed
2013-10-26 15:48 x42 Relationship added related to 0005752