Subj : Compiling from source To : tenser From : Oli Date : Mon Jan 18 2021 16:49:55 tenser wrote (2021-01-19): Ol>> I still get warnings like: Ol>> $ ./makespoon Ol>> spoon.cpp:60:7: warning: built-in function ‘logf’ declared as Ol>> non-function [-Wbuiltin-declaration-mismatch] Ol>> FILE *logf = NULL; Ol>> ^~~~ t> Ah, this is due to an unfortunate name. `logf` is the t> name of a function from the standard math library t> (single-precision floating point natural logarithm), that worked. Ol>> spoon.cpp: In function ‘void checkdir(char*)’: Ol>> spoon.cpp:143:69: warning: ISO C++ forbids converting a string Ol>> constant to ‘char*’ [-Wwrite-strings] Ol>> logprintf("FATAL ERROR: subdirectory %s does not exist\n", Ol>> dir); Ol>> but it compiles and run. t> This is a single type error. `logprintf` is probably t> defined to take `char *` as its first argument; this t> warning is saying that one is passing a string constant t> as that argument, but that the function is defined so t> that it could mutate the thing it points to. The fix t> here is to add a `const` qualifier to the argument. void logprintf(const char *s, ...); compiles, but so does void logprintf(char const *s, ...); is it the same? --- * Origin: this message must NOT be gated to Telegram (21:3/102) .