[PATCH 2/3] msqid: Provide internal copy of struct __msqid64_ds

Joseph Myers joseph@codesourcery.com
Mon Nov 9 20:28:56 GMT 2020


On Mon, 9 Nov 2020, Lukasz Majewski wrote:

> > If in a particular case defining the struct tag as a macro is unsafe,
> 
> Could you explain why having construct as:
> 
> #define timespec __timespec64 in ./time/bits/types/struct_timespec.c is
> unsafe (after having the file ./time/bits/types/struct___timespec64.c
> exported)?

I think "#define stat __stat64_time64" is unsafe, since people may do 
"#undef stat" to get a function rather than a macro (and thereby suppress 
the macro expansion for the struct tag as well).

I'm less sure there would be any problems with "#define timespec 
__timespec64".  The POSIX namespace rules are clearer on e.g. what's 
reserved with file scope, than on what's reserved as a macro name that the 
user mustn't undefine.

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Libc-alpha mailing list