Re: [PATCH 1/1] ACPI: Fix building with GCC 15

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 15.04.2025 19:04, David Laight wrote:
> 
> Doesn't than generate an 'unknown attribute' error on older compilers?
> 
> Does:
> 	typedef char char_nonstring __attribute__((nonstring));
> 	char_nonstring name[4] = "abcd";
> work?
> 
> If so the attribute could even be applied to 'u8'.
> 
> 	David

David, what if I used the __nonstring attribute from
include/linux/compiler_attributes.h which defines the following

#if __has_attribute(__nonstring__)
# define __nonstring                    __attribute__((__nonstring__))
#else
# define __nonstring
#endif

Which I came across from
https://www.kernel.org/doc/html/latest/process/programming-language.html#attributes
Also the checkpatch.pl scripts suggests using that instead.

I guess this would work from older compilers as well.

-- 
Regards,
listout




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux