huzheng001/stardict-3

error: variable length array of non-POD element type 'std::vector<gchar *>'

Closed this issue · 3 comments

What steps will reproduce the problem?
1. compile stardict 3.0.4 with clang

What is the expected output? What do you see instead?
Expected successful compile but got:

t_lookupdata.cpp:41:30: error: variable length array of non-POD element type 
'std::vector<gchar *>'

I previously noted this here: https://trac.macports.org/ticket/34517

What version of the product are you using? On what operating system?
stardict 3.0.4 on OS X 10.8.5 with Xcode 4.6.3 and its Apple LLVM version 4.2 
(clang-425.0.28) (based on LLVM 3.2svn)

Please provide any additional information below.
Compiling with llvm-gcc-4.2 instead works, however clang is the only compiler 
included in Xcode 5 and later so you should fix your code to be compilable with 
it.

Original issue reported on code.google.com by ryandesi...@gmail.com on 24 Sep 2013 at 4:22

Fixed in hg source repository!

Original comment by huzheng...@gmail.com on 30 Oct 2013 at 9:10

  • Changed state: Fixed

Please reopen; this is not fixed.

The only commit from 30 Oct 2013 was a9e0ea5 which appears to be a combination of many things. I think you think a9e0ea5#diff-81c516a825e3515a8f111def22b5ef2e fixed it, but it looks like that's still a variable-length array: the length is computed at runtime, rather than at compile time as is required by the C++ standard.

stardict 3.0.6.2 still has this problem when compiling with Apple Clang versions earlier than 900. With Apple Clang 900 and later the build succeeds.