Menu

#334 [PATCH] flac-1.2.1 incorrect vararray availability detection

closed-accepted
6
2014-08-31
2008-06-25
Nico
No

In flac-1.2.1/src/libFLAC++/stream_encoder.cpp, starting in line 196, there is a heuristic to find out whether variable-length arrays are supported. This does not work properly under certain conditions. Example: gcc-4.3.1 with ‘-pedantic’ in CXXFLAGS. Result: the code cannot be built.

I am attaching a patch which fixes the issue by adding an autoconf test for the usability of variable-length arrays in C++.

Please note that this patch currently causes the macro HAVE_C_VARARRAYS to be used for C++ code. This is not a problem at the moment, since C++ code is the /only/ place where this macro is checked. But the availability of variable-length arrays in C and C++ may differ, so if, at some later time, C code wants to check for that, /too,/ configure.in should be extended to AC_DEFINE the result of the test for C++ to another macro, let’s say HAVE_CXX_VARARRAYS, and then clear the result and repeat the test for the C language. The C code parts should then use HAVE_C_VARARRAYS, of course.

Thanks.

Discussion

  • Nico

    Nico - 2008-06-25

    Patch to convert detection of availability of variable-length arrays in C++ into an autoconf test

     
  • Josh Coalson

    Josh Coalson - 2009-01-02
    • priority: 5 --> 6
    • assigned_to: nobody --> jcoalson
    • status: open --> open-accepted
     
  • Josh Coalson

    Josh Coalson - 2009-01-03
    • status: open-accepted --> closed-accepted
     
  • Josh Coalson

    Josh Coalson - 2009-01-03

    thanks, fixed in cvs

     

Log in to post a comment.