View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0005751 | ardour | bugs | public | 2013-10-26 13:51 | 2013-10-26 15:17 |
| Reporter | nolaiz | Assigned To | x42 | ||
| Priority | normal | Severity | block | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Summary | 0005751: flag for c++11 is not -std=c++11 but -std=c++0x here (linux, gcc 4.6.4) | ||||
| Description | libs/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 | ||||
| Tags | No tags attached. | ||||
| related to | 0005752 | new | --cxx11 configuration flag broken for GCC<4.7 |
|
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++'])
|
|
|
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. |
|
|
resolved in 3.5-46-ge451411 by simply removing all c99 code :) please confirm and close the issue. |
|
|
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) |
|
|
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 :) |
| 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 |