Fix all current build warnings in the userland.

This commit is contained in:
Andreas Kling 2018-11-09 10:18:04 +01:00
parent e9cdb6bb9b
commit 3e0a0dd7ed
12 changed files with 42 additions and 25 deletions

View file

@ -1,8 +1,10 @@
#include <LibC/time.h>
#include <LibC/stdio.h>
int main(int c, char** v)
int main(int argc, char** argv)
{
(void) argc;
(void) argv;
time_t now = time(nullptr);
printf("%u\n", now);
return 0;

View file

@ -3,6 +3,8 @@
int main(int argc, char** argv)
{
(void) argc;
(void) argv;
printf("Testing fork()...\n");
pid_t pid = fork();
if (!pid) {

View file

@ -3,6 +3,8 @@
int main(int argc, char** argv)
{
(void) argc;
(void) argv;
printf("Testing fork()...\n");
pid_t pid = fork();
if (!pid) {

View file

@ -1,10 +1,12 @@
#include <LibC/unistd.h>
#include <LibC/stdio.h>
#include <LibC/errno.h>
#include <LibC/string.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
int main(int c, char** v)
int main(int argc, char** argv)
{
(void) argc;
(void) argv;
char buffer[HOST_NAME_MAX];
int rc = gethostname(buffer, sizeof(buffer));
if (rc < 0) {

View file

@ -4,8 +4,10 @@
#include <grp.h>
#include <alloca.h>
int main(int c, char** v)
int main(int argc, char** argv)
{
(void) argc;
(void) argv;
uid_t uid = getuid();
gid_t gid = getgid();

View file

@ -4,8 +4,10 @@
#include <LibC/errno.h>
#include <LibC/string.h>
int main(int c, char** v)
int main(int argc, char** argv)
{
(void) argc;
(void) argv;
bool colorize = true;
DIR* dirp = opendir(".");

View file

@ -1,8 +1,10 @@
#include <LibC/stdio.h>
#include <LibC/unistd.h>
int main(int c, char** v)
int main(int argc, char** argv)
{
(void) argc;
(void) argv;
int fd = open("/proc/mm", O_RDONLY);
if (fd == -1) {
perror("failed to open /proc/mm");

View file

@ -1,8 +1,10 @@
#include <LibC/stdio.h>
#include <LibC/unistd.h>
int main(int c, char** v)
int main(int argc, char** argv)
{
(void) argc;
(void) argv;
int fd = open("/proc/summary", O_RDONLY);
if (fd == -1) {
perror("failed to open /proc/summary");

View file

@ -1,11 +1,11 @@
#include <LibC/stdio.h>
#include <LibC/unistd.h>
#include <LibC/process.h>
#include <LibC/errno.h>
#include <LibC/string.h>
#include <LibC/stdlib.h>
#include <LibC/utsname.h>
#include <LibC/pwd.h>
#include <stdio.h>
#include <unistd.h>
#include <process.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <utsname.h>
#include <pwd.h>
#include <sys/mman.h>
#include <signal.h>
#include <AK/FileSystemPath.h>
@ -43,7 +43,7 @@ void did_receive_signal(int signum)
g_got_signal = true;
}
void handle_sigint(int signum)
void handle_sigint(int)
{
printf("Interrupt received by sh\n");
}
@ -105,7 +105,7 @@ static int sh_wt(int, const char**)
{
const char* rodata_ptr = "foo";
printf("Writing to rodata=%p...\n", rodata_ptr);
*(char*)rodata_ptr = 0;
*const_cast<char*>(rodata_ptr) = 0;
char* text_ptr = (char*)sh_fef;
printf("Writing to text=%p...\n", text_ptr);
@ -141,7 +141,6 @@ close_it:
static int sh_mp(int, const char**)
{
int rc;
int fd = open("/kernel.map", O_RDONLY);
if (fd < 0) {
perror("open(/kernel.map)");

View file

@ -2,6 +2,8 @@
int main(int argc, char** argv)
{
(void) argc;
(void) argv;
printf("Counting to 100000: \033[s");
for (unsigned i = 0; i <= 100000; ++i) {
printf("\033[u\033[s%u", i);

View file

@ -1,5 +1,5 @@
#include <LibC/stdio.h>
#include <LibC/unistd.h>
#include <stdio.h>
#include <unistd.h>
int main(int, char**)
{

View file

@ -1,5 +1,5 @@
#include <LibC/utsname.h>
#include <LibC/stdio.h>
#include <utsname.h>
#include <stdio.h>
int main(int argc, char** argv)
{