You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Designated initializers are a c99 feature not officially unsupported in C++/C++11. They are used in the hershey font hack and this code will not compile with g++ on linux. Clang happens to support them but we should not depend on this. You can see that support is a clang c99 extension if you build with -pedantic:
$ clang++ -o t src/geometry/debug_font_buffer.cpp -pedantic -Iinclude
In file included from src/geometry/debug_font_buffer.cpp:5:
src/geometry/debug_font.cpp:3:22: warning: zero size arrays are an extension [-Wzero-length-array]
int8_t simplex_0[] = { };
^
src/geometry/debug_font.cpp:108:16: warning: designated initializers are a C99 feature [-Wc99-extensions]
[' '] = { .width = 16, .length = sizeof(simplex_0), .data = simplex_0 },
^~~~~~~~~~~
src/geometry/debug_font.cpp:108:29: warning: designated initializers are a C99 feature [-Wc99-extensions]
[' '] = { .width = 16, .length = sizeof(simplex_0), .data = simplex_0 },
^~~~~~~~~~~~~~~~~~~~~~~~~~~
src/geometry/debug_font.cpp:108:58: warning: designated initializers are a C99 feature [-Wc99-extensions]
[' '] = { .width = 16, .length = sizeof(simplex_0), .data = simplex_0 },
^~~~~~~~~~~~~~~~~
Activity
kkaefer commentedon Feb 3, 2014
Dang, I knew that it was C99 only, but I thought I could sneak this through ;)
springmeyer commentedon Feb 3, 2014
It looks like this will compile with g++ 4.8:
Not sure if that breaks anything....
kkaefer commentedon Feb 3, 2014
Should be fine, just less explicit.