Skip to content

Commit

Permalink
genoffsets: Remove constexpr on PORT_OFFSETS array
Browse files Browse the repository at this point in the history
Not sure why CLang doesn't allow this to be constexpr while GCC does,
let's figure out later why this is the case.

Error message:

   src/dynports.cc:13:45: error: constexpr variable cannot have
       non-literal type 'const std::array<uint16_t, 4576>' (aka 'const
       array<unsigned short, 4576>')
   static constexpr std::array<uint16_t, 4576> PORT_OFFSETS {{
                                               ^

Signed-off-by: aszlig <[email protected]>
  • Loading branch information
aszlig committed Jul 8, 2020
1 parent 5911036 commit 5887a4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/genoffsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
formatted = [', '.join(['{:>5}'.format(o) for o in chunk])
for chunk in chunks]

sig = 'static constexpr std::array<uint16_t, {}> PORT_OFFSETS'
sig = 'static std::array<uint16_t, {}> PORT_OFFSETS'
header = sig.format(len(offsets)) + ' {{\n '
out = header + ',\n '.join(formatted) + '\n}};\n'

Expand Down

0 comments on commit 5887a4b

Please sign in to comment.