mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
* io/bits/fcntl2.h (open, open64, openat, openat64): Add
__extension__ around the whole statement expression. 2007-08-04 Jakub Jelinek <jakub@redhat.com> * io/bits/fcntl2.h (open, open64, openat, openat64): Add __extension__ around the whole statement expression.
This commit is contained in:
@ -1,3 +1,8 @@
|
||||
2007-08-04 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* io/bits/fcntl2.h (open, open64, openat, openat64): Add
|
||||
__extension__ around the whole statement expression.
|
||||
|
||||
2007-08-04 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* sysdeps/unix/opendir.c (__alloc_dir): Correct order of DIR
|
||||
|
@ -31,10 +31,11 @@ extern int __REDIRECT (__open_2, (__const char *__file, int __oflag),
|
||||
#endif
|
||||
|
||||
#define open(fname, flags, ...) \
|
||||
(__extension__ \
|
||||
({ int ___r; \
|
||||
/* If the compiler complains about an invalid type, excess elements, etc \
|
||||
in the initialization this means a parameter of the wrong type has \
|
||||
been passed to open. */ \
|
||||
/* If the compiler complains about an invalid type, excess elements, \
|
||||
etc. in the initialization this means a parameter of the wrong type \
|
||||
has been passed to open. */ \
|
||||
int ___arr[] = { __VA_ARGS__ }; \
|
||||
if (__builtin_constant_p (flags) && ((flags) & O_CREAT) != 0) \
|
||||
{ \
|
||||
@ -42,7 +43,7 @@ extern int __REDIRECT (__open_2, (__const char *__file, int __oflag),
|
||||
mode parameter is missing since O_CREAT has been used. */ \
|
||||
typedef int __open_missing_mode[((flags) & O_CREAT) != 0 \
|
||||
? ((long int) sizeof (___arr) \
|
||||
- (long int) sizeof (int)) : 1]; \
|
||||
- (long int) sizeof (int)) : 1];\
|
||||
} \
|
||||
if (sizeof (___arr) == 0) \
|
||||
{ \
|
||||
@ -55,21 +56,23 @@ extern int __REDIRECT (__open_2, (__const char *__file, int __oflag),
|
||||
{ \
|
||||
/* If the compiler complains about the size of this array type too \
|
||||
many parameters have been passed to open. */ \
|
||||
typedef int __open_too_many_args[-(sizeof (___arr) > sizeof (int))]; \
|
||||
typedef int __open_too_many_args[-(sizeof (___arr) \
|
||||
> sizeof (int))]; \
|
||||
___r = open (fname, flags, ___arr[0]); \
|
||||
} \
|
||||
___r; \
|
||||
})
|
||||
}))
|
||||
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int __open64_2 (__const char *__path, int __oflag) __nonnull ((1));
|
||||
|
||||
# define open64(fname, flags, ...) \
|
||||
(__extension__ \
|
||||
({ int ___r; \
|
||||
/* If the compiler complains about an invalid type, excess elements, etc \
|
||||
in the initialization this means a parameter of the wrong type has \
|
||||
been passed to open64. */ \
|
||||
/* If the compiler complains about an invalid type, excess elements, \
|
||||
etc. in the initialization this means a parameter of the wrong type \
|
||||
has been passed to open64. */ \
|
||||
int ___arr[] = { __VA_ARGS__ }; \
|
||||
if (__builtin_constant_p (flags) && ((flags) & O_CREAT) != 0) \
|
||||
{ \
|
||||
@ -77,7 +80,7 @@ extern int __open64_2 (__const char *__path, int __oflag) __nonnull ((1));
|
||||
mode parameter is missing since O_CREAT has been used. */ \
|
||||
typedef int __open_missing_mode[((flags) & O_CREAT) != 0 \
|
||||
? ((long int) sizeof (___arr) \
|
||||
- (long int) sizeof (int)) : 1]; \
|
||||
- (long int) sizeof (int)) : 1];\
|
||||
} \
|
||||
if (sizeof (___arr) == 0) \
|
||||
{ \
|
||||
@ -90,11 +93,12 @@ extern int __open64_2 (__const char *__path, int __oflag) __nonnull ((1));
|
||||
{ \
|
||||
/* If the compiler complains about the size of this array type too \
|
||||
many parameters have been passed to open64. */ \
|
||||
typedef int __open_too_many_args[-(sizeof (___arr) > sizeof (int))]; \
|
||||
typedef int __open_too_many_args[-(sizeof (___arr) \
|
||||
> sizeof (int))]; \
|
||||
___r = open64 (fname, flags, ___arr[0]); \
|
||||
} \
|
||||
___r; \
|
||||
})
|
||||
}))
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ATFILE
|
||||
@ -108,10 +112,11 @@ extern int __REDIRECT (__openat_2, (int __fd, __const char *__file,
|
||||
# endif
|
||||
|
||||
# define openat(fd, fname, flags, ...) \
|
||||
(__extension__ \
|
||||
({ int ___r; \
|
||||
/* If the compiler complains about an invalid type, excess elements, etc \
|
||||
in the initialization this means a parameter of the wrong type has \
|
||||
been passed to openat. */ \
|
||||
/* If the compiler complains about an invalid type, excess elements, \
|
||||
etc. in the initialization this means a parameter of the wrong type \
|
||||
has been passed to openat. */ \
|
||||
int ___arr[] = { __VA_ARGS__ }; \
|
||||
if (__builtin_constant_p (flags) && ((flags) & O_CREAT) != 0) \
|
||||
{ \
|
||||
@ -119,7 +124,7 @@ extern int __REDIRECT (__openat_2, (int __fd, __const char *__file,
|
||||
mode parameter is missing since O_CREAT has been used. */ \
|
||||
typedef int __open_missing_mode[((flags) & O_CREAT) != 0 \
|
||||
? ((long int) sizeof (___arr) \
|
||||
- (long int) sizeof (int)) : 1]; \
|
||||
- (long int) sizeof (int)) : 1];\
|
||||
} \
|
||||
if (sizeof (___arr) == 0) \
|
||||
{ \
|
||||
@ -132,11 +137,12 @@ extern int __REDIRECT (__openat_2, (int __fd, __const char *__file,
|
||||
{ \
|
||||
/* If the compiler complains about the size of this array type too \
|
||||
many parameters have been passed to openat. */ \
|
||||
typedef int __open_too_many_args[-(sizeof (___arr) > sizeof (int))]; \
|
||||
typedef int __open_too_many_args[-(sizeof (___arr) \
|
||||
> sizeof (int))]; \
|
||||
___r = openat (fd, fname, flags, ___arr[0]); \
|
||||
} \
|
||||
___r; \
|
||||
})
|
||||
}))
|
||||
|
||||
|
||||
# ifdef __USE_LARGEFILE64
|
||||
@ -144,10 +150,11 @@ extern int __openat64_2 (int __fd, __const char *__path, int __oflag)
|
||||
__nonnull ((2));
|
||||
|
||||
# define openat64(fd, fname, flags, ...) \
|
||||
(__extension__ \
|
||||
({ int ___r; \
|
||||
/* If the compiler complains about an invalid type, excess elements, etc \
|
||||
in the initialization this means a parameter of the wrong type has \
|
||||
been passed to openat64. */ \
|
||||
/* If the compiler complains about an invalid type, excess elements, \
|
||||
etc. in the initialization this means a parameter of the wrong type \
|
||||
has been passed to openat64. */ \
|
||||
int ___arr[] = { __VA_ARGS__ }; \
|
||||
if (__builtin_constant_p (flags) && ((flags) & O_CREAT) != 0) \
|
||||
{ \
|
||||
@ -155,7 +162,7 @@ extern int __openat64_2 (int __fd, __const char *__path, int __oflag)
|
||||
mode parameter is missing since O_CREAT has been used. */ \
|
||||
typedef int __open_missing_mode[((flags) & O_CREAT) != 0 \
|
||||
? ((long int) sizeof (___arr) \
|
||||
- (long int) sizeof (int)) : 1]; \
|
||||
- (long int) sizeof (int)) : 1];\
|
||||
} \
|
||||
if (sizeof (___arr) == 0) \
|
||||
{ \
|
||||
@ -168,10 +175,11 @@ extern int __openat64_2 (int __fd, __const char *__path, int __oflag)
|
||||
{ \
|
||||
/* If the compiler complains about the size of this array type too \
|
||||
many parameters have been passed to openat64. */ \
|
||||
typedef int __open_too_many_args[-(sizeof (___arr) > sizeof (int))]; \
|
||||
typedef int __open_too_many_args[-(sizeof (___arr) \
|
||||
> sizeof (int))]; \
|
||||
___r = openat64 (fd, fname, flags, ___arr[0]); \
|
||||
} \
|
||||
___r; \
|
||||
})
|
||||
}))
|
||||
# endif
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user