summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibC/stdlib.h
diff options
context:
space:
mode:
authorDaniel Bertalan <dani@danielbertalan.dev>2022-01-08 15:32:59 +0100
committerLinus Groh <mail@linusgroh.de>2022-01-08 19:22:00 +0100
commitb9c753f6f9c0e738e671766c323aef82b6f04056 (patch)
treec997c9e6781fc58a8cfe47b054036d1bdb72c656 /Userland/Libraries/LibC/stdlib.h
parenta221596614cde869d0b0ef1036c2a9e9ba48f0c5 (diff)
downloadserenity-b9c753f6f9c0e738e671766c323aef82b6f04056.zip
LibC+LibDl: Declare functions taking no arguments as taking void
In C++, a function declaration with an empty parameter list means that the function takes no arguments. In C, however, it means that the function takes an unspecified number of parameters. What we did previously was therefore non-conforming. This caused a config check to fail in the curl port, as it was able to redeclare `rand` as taking an int parameter.
Diffstat (limited to 'Userland/Libraries/LibC/stdlib.h')
-rw-r--r--Userland/Libraries/LibC/stdlib.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibC/stdlib.h b/Userland/Libraries/LibC/stdlib.h
index 68caf7a3cb..abab2a44cb 100644
--- a/Userland/Libraries/LibC/stdlib.h
+++ b/Userland/Libraries/LibC/stdlib.h
@@ -16,7 +16,7 @@ __BEGIN_DECLS
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1
-__attribute__((noreturn)) void _abort();
+__attribute__((noreturn)) void _abort(void);
__attribute__((malloc)) __attribute__((alloc_size(1))) void* malloc(size_t);
__attribute__((malloc)) __attribute__((alloc_size(1, 2))) void* calloc(size_t nmemb, size_t);
@@ -33,7 +33,7 @@ int putenv(char*);
int unsetenv(const char*);
int clearenv(void);
int setenv(const char* name, const char* value, int overwrite);
-const char* getprogname();
+const char* getprogname(void);
void setprogname(const char*);
int atoi(const char*);
long atol(const char*);
@@ -47,9 +47,9 @@ unsigned long long strtoull(const char*, char** endptr, int base);
unsigned long strtoul(const char*, char** endptr, int base);
void qsort(void* base, size_t nmemb, size_t size, int (*compar)(const void*, const void*));
void qsort_r(void* base, size_t nmemb, size_t size, int (*compar)(const void*, const void*, void*), void* arg);
-int atexit(void (*function)());
+int atexit(void (*function)(void));
__attribute__((noreturn)) void exit(int status);
-__attribute__((noreturn)) void abort();
+__attribute__((noreturn)) void abort(void);
char* ptsname(int fd);
int ptsname_r(int fd, char* buffer, size_t);
int abs(int);
@@ -70,10 +70,10 @@ char* realpath(const char* pathname, char* buffer);
__attribute__((noreturn)) void _Exit(int status);
#define RAND_MAX 32767
-int rand();
+int rand(void);
void srand(unsigned seed);
-long int random();
+long int random(void);
void srandom(unsigned seed);
uint32_t arc4random(void);