LibC+userspace: Make everything compile with -Wall -Wextra -Werror
I added -Wall -Wextra -Werror as public compile flags to libc. Now everything in userspace in compiled using these flags. I made all necessary changes to allow compilation to work. Only exception is execvp which has a large stack usage. Maybe it should use malloc for the buffer but posix allows ENOMEM only when kernel is out of memory... This can be fixed when fexecve is implemented and there is no need for absolute path.
This commit is contained in:
@@ -600,7 +600,6 @@ int execute_piped_commands(BAN::Vector<BAN::Vector<BAN::String>>& commands)
|
||||
int next_stdin = STDIN_FILENO;
|
||||
for (size_t i = 0; i < commands.size(); i++)
|
||||
{
|
||||
bool first = (i == 0);
|
||||
bool last = (i == commands.size() - 1);
|
||||
|
||||
int pipefd[2] { -1, STDOUT_FILENO };
|
||||
@@ -831,7 +830,7 @@ int prompt_length()
|
||||
void print_prompt()
|
||||
{
|
||||
auto prompt = get_prompt();
|
||||
fprintf(stdout, "%.*s", prompt.size(), prompt.data());
|
||||
fprintf(stdout, "%.*s", (int)prompt.size(), prompt.data());
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user