Thread (9 messages) 9 messages, 3 authors, 2025-08-25

Re: [PATCH] uapi/fcntl: conditionally define AT_RENAME* macros

From: Matthew Wilcox <willy@infradead.org>
Date: 2025-08-24 23:40:29
Also in: linux-fsdevel, lkml

On Sun, Aug 24, 2025 at 03:10:55PM -0700, Randy Dunlap wrote:
Don't define the AT_RENAME_* macros when __USE_GNU is defined since
/usr/include/stdio.h defines them in that case (i.e. when _GNU_SOURCE
is defined, which causes __USE_GNU to be defined).

Having them defined in 2 places causes build warnings (duplicate
definitions) in both samples/watch_queue/watch_test.c and
samples/vfs/test-statx.c.
It does?  What flags?

#define AT_RENAME_NOREPLACE     0x0001
#define AT_RENAME_NOREPLACE     0x0001

int main(void)
{
	return AT_RENAME_NOREPLACE;
}

gcc -W -Wall testA.c -o testA

(no warnings)

I'm pretty sure C says that duplicate definitions are fine as long
as they're identical.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help