Simplify test-snippets in configure.cmake

The main(void) signature obviates the need for unused parameters and
has existed since (at least) C89; so use that instead of the
old-fashioned argc/argv arguments we don't use in any of these tests.

Change-Id: Ibfe850a1fce378673c9781011475ea623fd75ad4
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Edward Welbourne 2021-02-12 12:31:17 +01:00
parent 5645ef305a
commit 73fbf8bd30
9 changed files with 121 additions and 242 deletions

View File

@ -28,9 +28,8 @@ qt_config_compile_test(cxx14
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
/* END TEST: */
@ -53,9 +52,8 @@ qt_config_compile_test(cxx17
#include <variant>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
std::variant<int> v(42);
int i = std::get<int>(v);
@ -78,9 +76,8 @@ qt_config_compile_test(cxx20
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
/* END TEST: */
@ -99,9 +96,8 @@ qt_config_compile_test(precompile_header
#ifndef HEADER_H
#error no go
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
/* END TEST: */
@ -149,9 +145,8 @@ qt_config_compile_test(reduce_relocations
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
/* END TEST: */
@ -172,9 +167,8 @@ qt_config_compile_test(signaling_nan
"#include <limits>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
using B = std::numeric_limits<double>;
static_assert(B::has_signaling_NaN, \"System lacks signaling NaN\");
@ -254,9 +248,8 @@ qt_config_compile_test(posix_fallocate
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
(void) posix_fallocate(0, 0, 0);
/* END TEST: */
@ -271,9 +264,8 @@ qt_config_compile_test(alloca_stdlib_h
"
#include <stdlib.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
alloca(1);
/* END TEST: */
@ -291,9 +283,8 @@ qt_config_compile_test(alloca_h
// extra include needed in QNX7 to define NULL for the alloca() macro
# include <stddef.h>
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
alloca(1);
/* END TEST: */
@ -308,9 +299,8 @@ qt_config_compile_test(alloca_malloc_h
"
#include <malloc.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
alloca(1);
/* END TEST: */
@ -331,9 +321,8 @@ qt_config_compile_test(stack_protector
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
/* END TEST: */
@ -348,9 +337,8 @@ qt_config_compile_test(intelcet
"
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
#if !defined(__CET__)
# error Intel CET not available

View File

@ -28,9 +28,8 @@ qt_config_compile_test(cxx14
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
/* END TEST: */
@ -53,9 +52,8 @@ qt_config_compile_test(cxx17
#include <variant>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
std::variant<int> v(42);
int i = std::get<int>(v);
@ -78,9 +76,8 @@ qt_config_compile_test(cxx20
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
/* END TEST: */
@ -99,9 +96,8 @@ qt_config_compile_test(precompile_header
#ifndef HEADER_H
#error no go
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
/* END TEST: */
@ -149,9 +145,8 @@ qt_config_compile_test(reduce_relocations
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
/* END TEST: */
@ -172,9 +167,8 @@ qt_config_compile_test(signaling_nan
"#include <limits>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
using B = std::numeric_limits<double>;
static_assert(B::has_signaling_NaN, \"System lacks signaling NaN\");
@ -254,9 +248,8 @@ qt_config_compile_test(posix_fallocate
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
(void) posix_fallocate(0, 0, 0);
/* END TEST: */
@ -271,9 +264,8 @@ qt_config_compile_test(alloca_stdlib_h
"
#include <stdlib.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
alloca(1);
/* END TEST: */
@ -291,9 +283,8 @@ qt_config_compile_test(alloca_h
// extra include needed in QNX7 to define NULL for the alloca() macro
# include <stddef.h>
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
alloca(1);
/* END TEST: */
@ -308,9 +299,8 @@ qt_config_compile_test(alloca_malloc_h
"
#include <malloc.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
alloca(1);
/* END TEST: */
@ -331,9 +321,8 @@ qt_config_compile_test(stack_protector
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
/* END TEST: */
@ -348,9 +337,8 @@ qt_config_compile_test(intelcet
"
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
#if !defined(__CET__)
# error Intel CET not available

View File

@ -55,9 +55,8 @@ void test(volatile atomicfptr &a)
}
a.store(&testfunction, std::memory_order_release);
}
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
atomicfptr fptr(testfunction);
test(fptr);
@ -76,9 +75,8 @@ qt_config_compile_test(clock_monotonic
#include <unistd.h>
#include <time.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
#if defined(_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK-0 >= 0)
timespec ts;
@ -101,9 +99,8 @@ qt_config_compile_test(cloexec
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
int pipes[2];
(void) pipe2(pipes, O_CLOEXEC | O_NONBLOCK);
@ -126,9 +123,8 @@ qt_config_compile_test(cxx11_future
"
#include <future>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
std::future<int> f = std::async([]() { return 42; });
(void)f.get();
@ -145,9 +141,8 @@ qt_config_compile_test(cxx11_random
"
#include <random>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
std::mt19937 mt(0);
/* END TEST: */
@ -162,9 +157,8 @@ qt_config_compile_test(cxx17_filesystem
"
#include <filesystem>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
std::filesystem::copy(
std::filesystem::path(\"./file\"),
@ -182,9 +176,8 @@ qt_config_compile_test(eventfd
"
#include <sys/eventfd.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
eventfd_t value;
int fd = eventfd(0, EFD_CLOEXEC);
@ -202,9 +195,8 @@ qt_config_compile_test(futimens
"
#include <sys/stat.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
futimens(-1, 0);
/* END TEST: */
@ -220,9 +212,8 @@ qt_config_compile_test(futimes
"
#include <sys/time.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
futimes(-1, 0);
/* END TEST: */
@ -237,9 +228,8 @@ qt_config_compile_test(getauxval
"
#include <sys/auxv.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
(void) getauxval(AT_NULL);
/* END TEST: */
@ -254,9 +244,8 @@ qt_config_compile_test(getentropy
"
#include <unistd.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
char buf[32];
(void) getentropy(buf, sizeof(buf));
@ -272,9 +261,8 @@ qt_config_compile_test(glibc
"
#include <stdlib.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
return __GLIBC__;
/* END TEST: */
@ -289,9 +277,8 @@ qt_config_compile_test(inotify
"
#include <sys/inotify.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
inotify_init();
inotify_add_watch(0, \"foobar\", IN_ACCESS);
@ -312,9 +299,8 @@ qt_config_compile_test(ipc_sysv
#include <sys/shm.h>
#include <fcntl.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
key_t unix_key = ftok(\"test\", 'Q');
semctl(semget(unix_key, 1, 0666 | IPC_CREAT | IPC_EXCL), 0, IPC_RMID, 0);
@ -340,9 +326,8 @@ qt_config_compile_test(ipc_posix
#include <semaphore.h>
#include <fcntl.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
sem_close(sem_open(\"test\", O_CREAT | O_EXCL, 0666, 0));
shm_open(\"test\", O_RDWR | O_CREAT | O_EXCL, 0666);
@ -360,9 +345,8 @@ qt_config_compile_test(linkat
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
linkat(AT_FDCWD, \"foo\", AT_FDCWD, \"bar\", AT_SYMLINK_FOLLOW);
/* END TEST: */
@ -378,9 +362,8 @@ qt_config_compile_test(ppoll
#include <signal.h>
#include <poll.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
struct pollfd pfd;
struct timespec ts;
@ -400,9 +383,8 @@ qt_config_compile_test(pollts
#include <signal.h>
#include <time.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
struct pollfd pfd;
struct timespec ts;
@ -420,9 +402,8 @@ qt_config_compile_test(poll
"
#include <poll.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
struct pollfd pfd;
poll(&pfd, 1, 0);
@ -439,9 +420,8 @@ qt_config_compile_test(renameat2
#include <fcntl.h>
#include <stdio.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
renameat2(AT_FDCWD, argv[1], AT_FDCWD, argv[2], RENAME_NOREPLACE | RENAME_WHITEOUT);
/* END TEST: */
@ -459,9 +439,8 @@ qt_config_compile_test(statx
#include <unistd.h>
#include <fcntl.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
struct statx statxbuf;
unsigned int mask = STATX_BASIC_STATS;
@ -478,9 +457,8 @@ qt_config_compile_test(syslog
"
#include <syslog.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
openlog(\"qt\", 0, LOG_USER);
syslog(LOG_INFO, \"configure\");
@ -506,9 +484,8 @@ qt_config_compile_test(xlocalescanprint
#define QT_NO_DOUBLECONVERSION
#include QDSP_P_H
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
#ifdef _MSVC_VER
_locale_t invalidLocale = NULL;

View File

@ -55,9 +55,8 @@ void test(volatile atomicfptr &a)
}
a.store(&testfunction, std::memory_order_release);
}
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
atomicfptr fptr(testfunction);
test(fptr);
@ -76,9 +75,8 @@ qt_config_compile_test(clock_monotonic
#include <unistd.h>
#include <time.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
#if defined(_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK-0 >= 0)
timespec ts;
@ -101,9 +99,8 @@ qt_config_compile_test(cloexec
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
int pipes[2];
(void) pipe2(pipes, O_CLOEXEC | O_NONBLOCK);
@ -132,9 +129,8 @@ qt_config_compile_test(cxx11_future
"
#include <future>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
std::future<int> f = std::async([]() { return 42; });
(void)f.get();
@ -151,9 +147,8 @@ qt_config_compile_test(cxx11_random
"
#include <random>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
std::mt19937 mt(0);
/* END TEST: */
@ -168,9 +163,8 @@ qt_config_compile_test(cxx17_filesystem
"
#include <filesystem>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
std::filesystem::copy(
std::filesystem::path(\"./file\"),
@ -188,9 +182,8 @@ qt_config_compile_test(eventfd
"
#include <sys/eventfd.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
eventfd_t value;
int fd = eventfd(0, EFD_CLOEXEC);
@ -208,9 +201,8 @@ qt_config_compile_test(futimens
"
#include <sys/stat.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
futimens(-1, 0);
/* END TEST: */
@ -226,9 +218,8 @@ qt_config_compile_test(futimes
"
#include <sys/time.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
futimes(-1, 0);
/* END TEST: */
@ -243,9 +234,8 @@ qt_config_compile_test(getauxval
"
#include <sys/auxv.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
(void) getauxval(AT_NULL);
/* END TEST: */
@ -260,9 +250,8 @@ qt_config_compile_test(getentropy
"
#include <unistd.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
char buf[32];
(void) getentropy(buf, sizeof(buf));
@ -278,9 +267,8 @@ qt_config_compile_test(glibc
"
#include <stdlib.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
return __GLIBC__;
/* END TEST: */
@ -295,9 +283,8 @@ qt_config_compile_test(inotify
"
#include <sys/inotify.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
inotify_init();
inotify_add_watch(0, \"foobar\", IN_ACCESS);
@ -318,9 +305,8 @@ qt_config_compile_test(ipc_sysv
#include <sys/shm.h>
#include <fcntl.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
key_t unix_key = ftok(\"test\", 'Q');
semctl(semget(unix_key, 1, 0666 | IPC_CREAT | IPC_EXCL), 0, IPC_RMID, 0);
@ -346,9 +332,8 @@ qt_config_compile_test(ipc_posix
#include <semaphore.h>
#include <fcntl.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
sem_close(sem_open(\"test\", O_CREAT | O_EXCL, 0666, 0));
shm_open(\"test\", O_RDWR | O_CREAT | O_EXCL, 0666);
@ -366,9 +351,8 @@ qt_config_compile_test(linkat
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
linkat(AT_FDCWD, \"foo\", AT_FDCWD, \"bar\", AT_SYMLINK_FOLLOW);
/* END TEST: */
@ -384,9 +368,8 @@ qt_config_compile_test(ppoll
#include <signal.h>
#include <poll.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
struct pollfd pfd;
struct timespec ts;
@ -406,9 +389,8 @@ qt_config_compile_test(pollts
#include <signal.h>
#include <time.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
struct pollfd pfd;
struct timespec ts;
@ -426,9 +408,8 @@ qt_config_compile_test(poll
"
#include <poll.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
struct pollfd pfd;
poll(&pfd, 1, 0);
@ -445,9 +426,8 @@ qt_config_compile_test(renameat2
#include <fcntl.h>
#include <stdio.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
renameat2(AT_FDCWD, argv[1], AT_FDCWD, argv[2], RENAME_NOREPLACE | RENAME_WHITEOUT);
/* END TEST: */
@ -465,9 +445,8 @@ qt_config_compile_test(statx
#include <unistd.h>
#include <fcntl.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
struct statx statxbuf;
unsigned int mask = STATX_BASIC_STATS;
@ -484,9 +463,8 @@ qt_config_compile_test(syslog
"
#include <syslog.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
openlog(\"qt\", 0, LOG_USER);
syslog(LOG_INFO, \"configure\");
@ -512,9 +490,8 @@ qt_config_compile_test(xlocalescanprint
#define QT_NO_DOUBLECONVERSION
#include QDSP_P_H
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
#ifdef _MSVC_VER
_locale_t invalidLocale = NULL;

View File

@ -144,9 +144,8 @@ extern \"C\" {
#include <xf86drmMode.h>
#include <xf86drm.h>
}
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
drmModeAtomicReq *request;
/* END TEST: */
@ -169,9 +168,8 @@ qt_config_compile_test(egl_x11
#include <EGL/egl.h>
#include <X11/Xlib.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
Display *dpy = EGL_DEFAULT_DISPLAY;
EGLNativeDisplayType egldpy = XOpenDisplay(\"\");
@ -194,9 +192,8 @@ qt_config_compile_test(egl_brcm
#include <EGL/egl.h>
#include <bcm_host.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
vc_dispmanx_display_open(0);
/* END TEST: */
@ -215,9 +212,8 @@ qt_config_compile_test(egl_egldevice
#include <EGL/egl.h>
#include <EGL/eglext.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
EGLDeviceEXT device = 0;
EGLStreamKHR stream = 0;
@ -239,9 +235,8 @@ qt_config_compile_test(egl_mali
#include <EGL/egl.h>
#include <GLES2/gl2.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
fbdev_window *w = 0;
/* END TEST: */
@ -259,9 +254,8 @@ qt_config_compile_test(egl_mali_2
#include <EGL/egl.h>
#include <GLES2/gl2.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
mali_native_window *w = 0;
/* END TEST: */
@ -279,9 +273,8 @@ qt_config_compile_test(egl_viv
#include <EGL/egl.h>
#include <EGL/eglvivante.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
#ifdef __INTEGRITY
fbGetDisplay();
@ -305,9 +298,8 @@ qt_config_compile_test(egl_openwfd
"
#include <wfd.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
wfdEnumerateDevices(nullptr, 0, nullptr);
/* END TEST: */
@ -327,9 +319,8 @@ qt_config_compile_test(egl_rcar
extern \"C\" {
extern unsigned long PVRGrfxServerInit(void);
}
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
PVRGrfxServerInit();
/* END TEST: */
@ -355,9 +346,8 @@ enum {
};
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
input_event buf[32];
(void) buf;
@ -373,9 +363,8 @@ qt_config_compile_test(integrityfb
"
#include <device/fbdriver.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
FBDriver *driver = 0;
/* END TEST: */
@ -392,9 +381,8 @@ qt_config_compile_test(linuxfb
#include <sys/kd.h>
#include <sys/ioctl.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
fb_fix_screeninfo finfo;
fb_var_screeninfo vinfo;
@ -420,9 +408,8 @@ qt_config_compile_test(opengles3
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
static GLfloat f[6];
glGetStringi(GL_EXTENSIONS, 0);
@ -443,9 +430,8 @@ qt_config_compile_test(opengles31
"
#include <GLES3/gl31.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
glDispatchCompute(1, 1, 1);
glProgramUniform1i(0, 0, 0);
@ -463,9 +449,8 @@ qt_config_compile_test(opengles32
"
#include <GLES3/gl32.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
glFramebufferTexture(GL_TEXTURE_2D, GL_DEPTH_STENCIL_ATTACHMENT, 1, 0);
/* END TEST: */
@ -505,9 +490,8 @@ qt_config_compile_test(xcb_syslibs
#include <xcb/xcb_renderutil.h>
#include <xcb/xkb.h>
#undef explicit
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
int primaryScreen = 0;
xcb_connection_t *c = xcb_connect(\"\", &primaryScreen);

View File

@ -144,9 +144,8 @@ extern \"C\" {
#include <xf86drmMode.h>
#include <xf86drm.h>
}
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
drmModeAtomicReq *request;
/* END TEST: */
@ -169,9 +168,8 @@ qt_config_compile_test(egl_x11
#include <EGL/egl.h>
#include <X11/Xlib.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
Display *dpy = EGL_DEFAULT_DISPLAY;
EGLNativeDisplayType egldpy = XOpenDisplay(\"\");
@ -194,9 +192,8 @@ qt_config_compile_test(egl_brcm
#include <EGL/egl.h>
#include <bcm_host.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
vc_dispmanx_display_open(0);
/* END TEST: */
@ -215,9 +212,8 @@ qt_config_compile_test(egl_egldevice
#include <EGL/egl.h>
#include <EGL/eglext.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
EGLDeviceEXT device = 0;
EGLStreamKHR stream = 0;
@ -239,9 +235,8 @@ qt_config_compile_test(egl_mali
#include <EGL/egl.h>
#include <GLES2/gl2.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
fbdev_window *w = 0;
/* END TEST: */
@ -259,9 +254,8 @@ qt_config_compile_test(egl_mali_2
#include <EGL/egl.h>
#include <GLES2/gl2.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
mali_native_window *w = 0;
/* END TEST: */
@ -281,9 +275,8 @@ qt_config_compile_test(egl_viv
#include <EGL/egl.h>
#include <EGL/eglvivante.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
#ifdef __INTEGRITY
fbGetDisplay();
@ -307,9 +300,8 @@ qt_config_compile_test(egl_openwfd
"
#include <wfd.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
wfdEnumerateDevices(nullptr, 0, nullptr);
/* END TEST: */
@ -329,9 +321,8 @@ qt_config_compile_test(egl_rcar
extern \"C\" {
extern unsigned long PVRGrfxServerInit(void);
}
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
PVRGrfxServerInit();
/* END TEST: */
@ -357,9 +348,8 @@ enum {
};
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
input_event buf[32];
(void) buf;
@ -375,9 +365,8 @@ qt_config_compile_test(integrityfb
"
#include <device/fbdriver.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
FBDriver *driver = 0;
/* END TEST: */
@ -394,9 +383,8 @@ qt_config_compile_test(linuxfb
#include <sys/kd.h>
#include <sys/ioctl.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
fb_fix_screeninfo finfo;
fb_var_screeninfo vinfo;
@ -422,9 +410,8 @@ qt_config_compile_test(opengles3
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
static GLfloat f[6];
glGetStringi(GL_EXTENSIONS, 0);
@ -445,9 +432,8 @@ qt_config_compile_test(opengles31
"
#include <GLES3/gl31.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
glDispatchCompute(1, 1, 1);
glProgramUniform1i(0, 0, 0);
@ -465,9 +451,8 @@ qt_config_compile_test(opengles32
"
#include <GLES3/gl32.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
glFramebufferTexture(GL_TEXTURE_2D, GL_DEPTH_STENCIL_ATTACHMENT, 1, 0);
/* END TEST: */
@ -507,9 +492,8 @@ qt_config_compile_test(xcb_syslibs
#include <xcb/xcb_renderutil.h>
#include <xcb/xkb.h>
#undef explicit
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
int primaryScreen = 0;
xcb_connection_t *c = xcb_connect(\"\", &primaryScreen);

View File

@ -23,9 +23,8 @@ qt_config_compile_test(openssl_headers
#if !defined(OPENSSL_NO_EC) && !defined(SSL_CTRL_SET_CURVES)
# error OpenSSL was reported as >= 1.1.1 but is missing required features, possibly it is libressl which is unsupported
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
/* END TEST: */
@ -48,9 +47,8 @@ qt_config_compile_test(openssl
#if !defined(OPENSSL_NO_EC) && !defined(SSL_CTRL_SET_CURVES)
# error OpenSSL was reported as >= 1.1.1 but is missing required features, possibly it is libressl which is unsupported
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
SSL_free(SSL_new(0));
/* END TEST: */
@ -73,9 +71,8 @@ qt_config_compile_test(getifaddrs
#include <net/if.h>
#include <ifaddrs.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
ifaddrs *list;
getifaddrs(&list);
@ -95,9 +92,8 @@ qt_config_compile_test(ipv6ifname
#include <sys/socket.h>
#include <net/if.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
char buf[IFNAMSIZ];
if_nametoindex(\"eth0\");
@ -119,9 +115,8 @@ qt_config_compile_test(linux_netlink
#include <linux/rtnetlink.h>
#include <sys/socket.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
struct rtattr rta = { };
struct ifinfomsg ifi = {};
@ -147,9 +142,8 @@ qt_config_compile_test(sctp
#include <netinet/in.h>
#include <netinet/sctp.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
sctp_initmsg sctpInitMsg;
socklen_t sctpInitMsgSize = sizeof(sctpInitMsg);
@ -172,9 +166,8 @@ qt_config_compile_test(dtls
#if defined(OPENSSL_NO_DTLS) || !defined(DTLS1_2_VERSION)
# error OpenSSL without DTLS support
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
/* END TEST: */
@ -194,9 +187,8 @@ qt_config_compile_test(ocsp
#if defined(OPENSSL_NO_OCSP) || defined(OPENSSL_NO_TLSEXT)
# error OpenSSL without OCSP stapling
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
/* END TEST: */
@ -212,9 +204,8 @@ qt_config_compile_test(networklistmanager
#include <netlistmgr.h>
#include <wrl/client.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
using namespace Microsoft::WRL;
ComPtr<INetworkListManager> networkListManager;

View File

@ -23,9 +23,8 @@ qt_config_compile_test(openssl_headers
#if !defined(OPENSSL_NO_EC) && !defined(SSL_CTRL_SET_CURVES)
# error OpenSSL was reported as >= 1.1.1 but is missing required features, possibly it is libressl which is unsupported
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
/* END TEST: */
@ -48,9 +47,8 @@ qt_config_compile_test(openssl
#if !defined(OPENSSL_NO_EC) && !defined(SSL_CTRL_SET_CURVES)
# error OpenSSL was reported as >= 1.1.1 but is missing required features, possibly it is libressl which is unsupported
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
SSL_free(SSL_new(0));
/* END TEST: */
@ -73,9 +71,8 @@ qt_config_compile_test(getifaddrs
#include <net/if.h>
#include <ifaddrs.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
ifaddrs *list;
getifaddrs(&list);
@ -95,9 +92,8 @@ qt_config_compile_test(ipv6ifname
#include <sys/socket.h>
#include <net/if.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
char buf[IFNAMSIZ];
if_nametoindex(\"eth0\");
@ -119,9 +115,8 @@ qt_config_compile_test(linux_netlink
#include <linux/rtnetlink.h>
#include <sys/socket.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
struct rtattr rta = { };
struct ifinfomsg ifi = {};
@ -147,9 +142,8 @@ qt_config_compile_test(sctp
#include <netinet/in.h>
#include <netinet/sctp.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
sctp_initmsg sctpInitMsg;
socklen_t sctpInitMsgSize = sizeof(sctpInitMsg);
@ -172,9 +166,8 @@ qt_config_compile_test(dtls
#if defined(OPENSSL_NO_DTLS) || !defined(DTLS1_2_VERSION)
# error OpenSSL without DTLS support
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
/* END TEST: */
@ -194,9 +187,8 @@ qt_config_compile_test(ocsp
#if defined(OPENSSL_NO_OCSP) || defined(OPENSSL_NO_TLSEXT)
# error OpenSSL without OCSP stapling
#endif
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
/* END TEST: */
@ -212,9 +204,8 @@ qt_config_compile_test(networklistmanager
#include <netlistmgr.h>
#include <wrl/client.h>
int main(int argc, char **argv)
int main(void)
{
(void)argc; (void)argv;
/* BEGIN TEST: */
using namespace Microsoft::WRL;
ComPtr<INetworkListManager> networkListManager;

View File

@ -655,9 +655,8 @@ def write_compile_test(
sourceCode += tail + "\n"
sourceCode += "int main(int argc, char **argv)\n"
sourceCode += "int main(void)\n"
sourceCode += "{\n"
sourceCode += " (void)argc; (void)argv;\n"
sourceCode += " /* BEGIN TEST: */\n"
def resolve_main(detail):