WheretIB / nullc

Fast C-like programming language with advanced features
MIT License
162 stars 12 forks source link

sprintf is deprecated in Xcode 14, causing compilation warnings #36

Closed zeux closed 1 year ago

zeux commented 1 year ago

The recommended portable/safe alternative is snprintf.

Example warning:

NULLC/ExpressionTree.cpp:9478:4: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
                        sprintf(name, "%.*s$", FMT_ISTR(param->name->name));
                        ^

There's a far number of these, so this would need a mass search/replace of some sort:

nullc % make -B 2>&1 | grep warning: | wc -l
      77
WheretIB commented 1 year ago

Most should be fixed now, I will have another PR to fix these warnings in external dependencies.