While compiling code that includes Svar_signals.hh on macOS (Apple clang
version 21.0.0 (clang-2100.1.1.101) , I get the following warnings:
./Svar_signals.hh:473:46: warning: null passed to a callee
that requires a non-null argument [-Wnonnull]
473 | { bad_get("SET_STATE", "sloc"); return 0; }
| ^
./Svar_signals.hh:497:50: warning: null passed to a callee
that requires a non-null argument [-Wnonnull]
497 | { bad_get("VALUE_IS", "error_loc"); return 0; }
| ^
./Svar_signals.hh:499:50: warning: null passed to a callee
that requires a non-null argument [-Wnonnull]
499 | { bad_get("VALUE_IS", "cdr_value"); return 0; }
| ^
./Svar_signals.hh:507:54: warning: null passed to a callee
that requires a non-null argument [-Wnonnull]
507 | { bad_get("ASSIGN_VALUE", "cdr_value"); return 0; }
| ^
./Svar_signals.hh:516:55: warning: null passed to a callee
that requires a non-null argument [-Wnonnull]
516 | { bad_get("SVAR_ASSIGNED", "error_loc"); return 0; }
| ^
./Svar_signals.hh:547:53: warning: null passed to a callee
that requires a non-null argument [-Wnonnull]
547 | { bad_get("SVAR_RECORD_IS", "record"); return 0; }
| ^
./Svar_signals.hh:577:59: warning: null passed to a callee
that requires a non-null argument [-Wnonnull]
577 | { bad_get("REGISTER_PROCESSOR", "progname"); return 0; }
| ^
./Svar_signals.hh:583:53: warning: null passed to a callee
that requires a non-null argument [-Wnonnull]
583 | { bad_get("MATCH_OR_MAKE", "varname"); return 0; }
| ^
./Svar_signals.hh:630:65: warning: null passed to a callee
that requires a non-null argument [-Wnonnull]
630 | { bad_get("OFFERING_PROCS_ARE", "offering_procs"); return 0; }
| ^
./Svar_signals.hh:644:61: warning: null passed to a callee
that requires a non-null argument [-Wnonnull]
644 | { bad_get("OFFERED_VARS_ARE", "offered_vars"); return 0; }
| ^
./Svar_signals.hh:708:57: warning: null passed to a callee
that requires a non-null argument [-Wnonnull]
708 | { bad_get("ASSIGN_WSWS_VAR", "cdr_value"); return 0; }
| ^
./Svar_signals.hh:718:55: warning: null passed to a callee
that requires a non-null argument [-Wnonnull]
718 | { bad_get("WSWS_VALUE_IS", "cdr_value"); return 0; }
| ^
./Svar_signals.hh:727:56: warning: null passed to a callee
that requires a non-null argument [-Wnonnull]
727 | { bad_get("SVAR_DB_PRINTED", "printout"); return 0; }
| ^
These warnings appear to occur when the return type of the method definitions
that contain this code is "string", which I interpret to be the C++ std::string
data type.
Claude indicates that std::string is an object, not a pointer, so it can't be
assigned null (or any value that it can prove is null such as the number 0).
These warnings don't seem to appear on Linux/GCC - it looks like it is another
case where g++ is more lenient.
Switching those to a string constant of "0" does make the warning go away, but
I haven't run extensive testing to see if that's going break anything.
- Paul