Skip to content

Commit f3ca4fa

Browse files
committed
[lib] Fix typo and amend restrict qualifier
This removes an extraneous ',' in the generated dlfcn header. This also adds `__restrict` to `dladdr`'s declaration per POSIX. The `restrict` C standard keyword is removed from dlinfo.cpp/dlinfo.h (but note that the dlinfo's declaration in dlfcn.h still annoates __restrict in the decl).
1 parent 281e6d2 commit f3ca4fa

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

libc/include/dlfcn.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ enums:
4646
standards:
4747
- gnu
4848
value: 2
49-
- name: RTLD_DI_CONFIGADDR,
49+
- name: RTLD_DI_CONFIGADDR
5050
standards:
5151
- gnu
5252
value: 3
@@ -127,5 +127,5 @@ functions:
127127
- POSIX
128128
return_type: int
129129
arguments:
130-
- type: const void *
131-
- type: Dl_info *
130+
- type: const void *__restrict
131+
- type: Dl_info *__restrict

libc/src/dlfcn/dlinfo.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
namespace LIBC_NAMESPACE_DECL {
1616

1717
// TODO: https://github.com/llvm/llvm-project/issues/149911
18-
LLVM_LIBC_FUNCTION(int, dlinfo,
19-
(void *restrict handle, int request, void *restrict info)) {
18+
LLVM_LIBC_FUNCTION(int, dlinfo, (void *handle, int request, void *info)) {
2019
return -1;
2120
}
2221

libc/src/dlfcn/dlinfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace LIBC_NAMESPACE_DECL {
1515

16-
int dlinfo(void *restrict, int, void *restrict);
16+
int dlinfo(void *, int, void *);
1717

1818
} // namespace LIBC_NAMESPACE_DECL
1919

0 commit comments

Comments
 (0)