You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2026-06-20 01:17:49 +02:00
Suppress unused parameter errors in meson compiler probes.
The main() parameters in meson compiler probes were not being used but could cause unused parameter errors. Since the parameters are not needed remove them. This also has the benefit of making the code a bit simpler.
This commit is contained in:
@@ -1,2 +1,16 @@
|
||||
<release date="XXXX-XX-XX" version="2.59.0dev" title="UNDER DEVELOPMENT">
|
||||
<release-core-list>
|
||||
<release-improvement-list>
|
||||
<release-item>
|
||||
<github-issue id="2724"/>
|
||||
|
||||
<release-item-contributor-list>
|
||||
<release-item-contributor id="jorg.plate"/>
|
||||
<release-item-reviewer id="david.steele"/>
|
||||
</release-item-contributor-list>
|
||||
|
||||
<p>Suppress <id>unused parameter</id> errors in <proper>meson</proper> compiler probes.</p>
|
||||
</release-item>
|
||||
</release-improvement-list>
|
||||
</release-core-list>
|
||||
</release>
|
||||
|
||||
@@ -620,6 +620,11 @@
|
||||
<contributor-id type="github">jordanenglish</contributor-id>
|
||||
</contributor>
|
||||
|
||||
<contributor id="jorg.plate">
|
||||
<contributor-name-display>J&ouml;rg Plate</contributor-name-display>
|
||||
<contributor-id type="github">Patterner</contributor-id>
|
||||
</contributor>
|
||||
|
||||
<contributor id="julian.zhang">
|
||||
<contributor-name-display>Julian Zhang</contributor-name-display>
|
||||
<contributor-id type="github">julianzhang98</contributor-id>
|
||||
|
||||
+5
-5
@@ -150,12 +150,12 @@ add_project_arguments(cc.get_supported_arguments('-fmacro-prefix-map=@0@/test/sr
|
||||
configuration = configuration_data()
|
||||
|
||||
# Ensure the C compiler supports __builtin_clzl()
|
||||
if not cc.links('''int main(int arg, char **argv) {__builtin_clzl(1);}''')
|
||||
if not cc.links('''int main(void) {__builtin_clzl(1);}''')
|
||||
error('compiler must support __builtin_clzl()')
|
||||
endif
|
||||
|
||||
# Ensure the C compiler supports __builtin_bswap64()
|
||||
if not cc.links('''int main(int arg, char **argv) {__builtin_bswap64(1);}''')
|
||||
if not cc.links('''int main(void) {__builtin_bswap64(1);}''')
|
||||
error('compiler must support __builtin_bswap64()')
|
||||
endif
|
||||
|
||||
@@ -206,14 +206,14 @@ endif
|
||||
# Suppress -Wsign-conversion for C libraries (e.g. musl) that do no accept int without warning for FD_*() macros
|
||||
if not cc.compiles(
|
||||
'''#include <sys/select.h>
|
||||
int main(int arg, char **argv) {int fd = 1; fd_set s; FD_ZERO(&s); FD_SET(fd, &s); FD_ISSET(fd, &s);}''',
|
||||
int main(void) {int fd = 1; fd_set s; FD_ZERO(&s); FD_SET(fd, &s); FD_ISSET(fd, &s);}''',
|
||||
args: ['-Wsign-conversion', '-Werror'])
|
||||
message('Disabling -Wsign-conversion because int is not accepted without warning by FD_*() macros')
|
||||
add_project_arguments(cc.get_supported_arguments('-Wno-sign-conversion'), language: 'c')
|
||||
endif
|
||||
|
||||
# Check if the C compiler supports _Static_assert()
|
||||
if cc.compiles('''int main(int arg, char **argv) {({ _Static_assert(1, "foo");});} ''')
|
||||
if cc.compiles('''int main(void) {({ _Static_assert(1, "foo");});} ''')
|
||||
configuration.set('HAVE_STATIC_ASSERT', true, description: 'Does the compiler provide _Static_assert()?')
|
||||
endif
|
||||
|
||||
@@ -248,7 +248,7 @@ configuration.set(
|
||||
|
||||
# Set VR_NON_STRING macro
|
||||
if cc.compiles(
|
||||
'''int main(int arg, char **argv) {__attribute__((nonstring)) static char test[3] = "ABC";}''',
|
||||
'''int main(void) {__attribute__((nonstring)) static char test[3] = "ABC";}''',
|
||||
args: ['-Wextra', '-Werror'])
|
||||
configuration.set(
|
||||
'VR_NON_STRING', '__attribute__((nonstring))',
|
||||
|
||||
Reference in New Issue
Block a user