[PATCH 10/59] nss: Suppress clang -Wstring-plus-int on __nss_shlib_revision definition

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Mon Oct 20 12:48:37 GMT 2025



On 17/10/25 16:40, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> +/* clang issues an warning adding 'unsigned long' to a string does not append
>> +   to the string.  e.  */
>> +DIAG_PUSH_NEEDS_COMMENT_CLANG;
>> +DIAG_IGNORE_NEEDS_COMMENT_CLANG (18, "-Wstring-plus-int");
>>  static const char *const __nss_shlib_revision
>>  	= LIBNSS_FILES_SO + sizeof("libnss_files.so") - 1;
>> +DIAG_POP_NEEDS_COMMENT_CLANG;
> 
> Does this work instead?
> 
>   &LIBNSS_FILES_SO[sizeof("libnss_files.so") - 1]
> 

It does, I have fixed it using this strategy for other similar issues.
I will update this fix.


More information about the Libc-alpha mailing list