mirror of
https://github.com/fairyglade/ly.git
synced 2025-12-20 19:24:53 +00:00
Make the project compilable with clang. (#163)
Clang generates more warning messages, such as pointing out a lack of newline at end of file and issues with the size of a strncopy. Moving -Wno-unused-parameter to the end of the flags avoids it being overwritten by -Wextra. Removing -Werror avoids compilation errors that may arise from new compiler warnings that might come from newer versions of compilers.
This commit is contained in:
committed by
GitHub
parent
740e7393bb
commit
fa42781cb9
2
makefile
2
makefile
@@ -1,7 +1,7 @@
|
|||||||
NAME = ly
|
NAME = ly
|
||||||
CC = gcc
|
CC = gcc
|
||||||
FLAGS = -std=c99 -pedantic -g
|
FLAGS = -std=c99 -pedantic -g
|
||||||
FLAGS+= -Wall -Wno-unused-parameter -Wextra -Werror=vla -Werror
|
FLAGS+= -Wall -Wextra -Werror=vla -Wno-unused-parameter
|
||||||
#FLAGS+= -DDEBUG
|
#FLAGS+= -DDEBUG
|
||||||
FLAGS+= -DGIT_VERSION_STRING=\"$(shell git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g')\"
|
FLAGS+= -DGIT_VERSION_STRING=\"$(shell git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g')\"
|
||||||
LINK = -lpam -lxcb
|
LINK = -lpam -lxcb
|
||||||
|
|||||||
@@ -431,7 +431,7 @@ void shell(struct passwd* pwd)
|
|||||||
pos = pwd->pw_shell;
|
pos = pwd->pw_shell;
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy(args + 1, pos, 1024);
|
strncpy(args + 1, pos, 1023);
|
||||||
execl(pwd->pw_shell, args, NULL);
|
execl(pwd->pw_shell, args, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -671,4 +671,5 @@ void auth(
|
|||||||
{
|
{
|
||||||
pam_diagnose(ok, buf);
|
pam_diagnose(ok, buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user