caryll / otfcc

Optimized OpenType builder and inspector.
Apache License 2.0
422 stars 63 forks source link

`error: format string is not a string literal` in _TSI.c #49

Closed jfrankenau closed 7 years ago

jfrankenau commented 7 years ago

I'm trying to build otfcc v0.8.4 for NixOS. With Clang/LLVM as well as GCC I'm getting the following errors:

../../lib/table/_TSI.c:87:13: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
        loggedStep(tag) {
                   ^~~
../../lib/support/aliases.h:8:85: note: expanded from macro 'loggedStep'
                      (options->logger->startSDS(options->logger, sdscatprintf(sdsempty(), __VA_ARGS__)), true);           \
                                                                                           ^~~~~~~~~~~
../../lib/table/_TSI.c:87:13: note: treat the string as an argument to avoid this
        loggedStep(tag) {
                   ^
                   "%s", 
../../lib/support/aliases.h:8:85: note: expanded from macro 'loggedStep'
                      (options->logger->startSDS(options->logger, sdscatprintf(sdsempty(), __VA_ARGS__)), true);           \
                                                                                           ^
../../lib/table/_TSI.c:128:13: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
        loggedStep(tag) {
                   ^~~
../../lib/support/aliases.h:8:85: note: expanded from macro 'loggedStep'
                      (options->logger->startSDS(options->logger, sdscatprintf(sdsempty(), __VA_ARGS__)), true);           \
                                                                                           ^~~~~~~~~~~
../../lib/table/_TSI.c:128:13: note: treat the string as an argument to avoid this
        loggedStep(tag) {
                   ^
                   "%s", 
../../lib/support/aliases.h:8:85: note: expanded from macro 'loggedStep'
                      (options->logger->startSDS(options->logger, sdscatprintf(sdsempty(), __VA_ARGS__)), true);           \
                                                                                           ^
3 warnings and 2 errors generated.

I've followed the instructions with:

premake5 gmake
cd build/gmake
make config=release_x64

Any input on how to solve this?

be5invis commented 7 years ago

You can change loggedStep(tag) { into loggedStep("%s", tag){ and try to rebuild. I'd like to fix that tomorrow.

jfrankenau commented 7 years ago

Hah, I was building this one with GCC before and as always the error messages there suck. And after trying it with Clang I didn't even read them although they are so much better. Stupid me. Thank you, it builds fine now.

Also, thank you very much for Iosevka. It's such a beautiful font which is why I am preparing a new package for NixOS which allows to easily change the parameters instead of just pulling the TTFs.