#93

Fails to compile with glibc 2.43+

OpenMa27opened 1mo ago
base/thr_info.c: In function 'cmd_log':
base/thr_info.c:2179:25: error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
 2179 |         char* context = strchr(params, ARG_SEP);
      |                         ^~~~~~
base/thr_info.c: In function 'cmd_sets':
base/thr_info.c:2777:26: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
 2777 |                 set_name = strchr(params, ARG_SEP);
      |                          ^
base/thr_info.c: In function 'cmd_sindex':
base/thr_info.c:2824:28: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
 2824 |                 index_name = strchr(params, ARG_SEP);
      |                            ^

While that's an older version of the source-code, the problematic code is still there, e.g. https://github.com/aerospike/aerospike-server/blob/3c13b0de02f5ccaa6fffd8b9bbf3387b0c6a12dc/as/src/base/thr_info.c#L2431-L2435

The change causing trouble here is from ISO C23, when a const char* is passed to e.g. strchr, a const-qualified pointer is also being returned. params is a const char*, but e.g. context is a char*.

Activity

0

No activity yet.