jingoro2112 / wrench

practical embedded script interpreter
MIT License
106 stars 9 forks source link

Compilation error in gcc #34

Closed ohordiichuk closed 3 months ago

ohordiichuk commented 3 months ago
wrench/wrench/src/wrench.cpp:1973:54: error: 'strncasecmp' was not declared in this scope; did you mean 'strncmp'?
 1973 |     bool isMatchCase(const char* buf) const { return strncasecmp(buf, m_str, m_len) == 0; }
      |                                                      ^~~~~~~~~~~
      |                                                      strncmp
ninja: build stopped: subcommand failed.

compiler:

gcc version 12.2.0 (Zephyr SDK 0.16.5)

hot fix:

extern "C" {
#include <strings.h>
};
jingoro2112 commented 3 months ago

The purpose of strncasecmp is to compare two strings safely ignoring case. Which is what isMatchcase() does in that string class. It serves no purpose in wrench (it's from my own library) and I have removed it in 6.0.1

-Curt

On Fri, Jun 14, 2024 at 11:02 AM ohordiichuk @.***> wrote:

wrench/wrench/src/wrench.cpp:1973:54: error: 'strncasecmp' was not declared in this scope; did you mean 'strncmp'? 1973 | bool isMatchCase(const char* buf) const { return strncasecmp(buf, m_str, m_len) == 0; } | ^~~ | strncmp ninja: build stopped: subcommand failed.

compiler:

gcc version 12.2.0 (Zephyr SDK 0.16.5)

hot fix:

extern "C" {

include

};

— Reply to this email directly, view it on GitHub https://github.com/jingoro2112/wrench/issues/34, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALIKA75QW4LNIKJGG66EJLZHMAWRAVCNFSM6AAAAABJKQTWHOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM2TGNJWGY3DIMY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jingoro2112 commented 3 months ago

fixed