Skip to content

Commit ed27777

Browse files
switch to system compiler (GCC/Clang) (#678)
1 parent fa514e7 commit ed27777

6 files changed

Lines changed: 8 additions & 27 deletions

File tree

SConstruct

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,13 @@ elif GetOption('asan'):
5151

5252
env = Environment(
5353
ENV=os.environ,
54-
CC='clang',
55-
CXX='clang++',
5654
CCFLAGS=[
5755
"-g",
5856
"-fPIC",
5957
"-O2",
6058
"-Wunused",
6159
"-Werror",
62-
"-Wshadow",
60+
"-Wshadow" if arch == "Darwin" else "-Wshadow=local",
6361
"-Wno-vla-cxx-extension",
6462
"-Wno-unknown-warning-option",
6563
] + ccflags,
@@ -78,7 +76,7 @@ Export('env', 'arch', 'common')
7876

7977
envCython = env.Clone(LIBS=[])
8078
envCython["CPPPATH"] += [np.get_include()]
81-
envCython["CCFLAGS"] += ["-Wno-#warnings", "-Wno-shadow", "-Wno-deprecated-declarations"]
79+
envCython["CCFLAGS"] += ["-Wno-#warnings", "-Wno-cpp", "-Wno-shadow", "-Wno-deprecated-declarations"]
8280
envCython["CCFLAGS"].remove('-Werror')
8381
if arch == "Darwin":
8482
envCython["LINKFLAGS"] = ["-bundle", "-undefined", "dynamic_lookup"]

msgq/event.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ int Event::clear() const {
129129

130130
uint64_t val = 0;
131131
// read the eventfd to clear it
132-
read(this->event_fd, &val, sizeof(uint64_t));
132+
ssize_t ret = read(this->event_fd, &val, sizeof(uint64_t));
133+
assert(ret == sizeof(uint64_t));
133134

134135
return val;
135136
}

msgq/visionipc/visionbuf.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ static void *malloc_with_fd(size_t len, int *fd) {
2525

2626
unlink(full_path);
2727

28-
ftruncate(*fd, len);
28+
int ret = ftruncate(*fd, len);
29+
assert(ret == 0);
2930
void *addr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, *fd, 0);
3031
assert(addr != MAP_FAILED);
3132

msgq/visionipc/visionipc_client.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static int connect_to_vipc_server(const std::string &name, bool blocking) {
2222
return socket_fd;
2323
}
2424

25-
VisionIpcClient::VisionIpcClient(std::string name, VisionStreamType type, bool conflate) : name(name), type(type) {
25+
VisionIpcClient::VisionIpcClient(std::string name_, VisionStreamType type_, bool conflate) : name(name_), type(type_) {
2626
msg_ctx = Context::create();
2727
sock = SubSocket::create(msg_ctx, get_endpoint_name(name, type), "127.0.0.1", conflate, false);
2828

msgq/visionipc/visionipc_server.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ std::string get_ipc_path(const std::string& name) {
2626
return path + "visionipc_" + name;
2727
}
2828

29-
VisionIpcServer::VisionIpcServer(std::string name) : name(name) {
29+
VisionIpcServer::VisionIpcServer(std::string name_) : name(name_) {
3030
msg_ctx = Context::create();
3131

3232
std::random_device rd("/dev/urandom");

setup.sh

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,6 @@ cd $DIR
66

77
PLATFORM=$(uname -s)
88

9-
echo "installing dependencies"
10-
if [[ $PLATFORM == "Darwin" ]]; then
11-
if ! command -v python3 &>/dev/null; then
12-
export HOMEBREW_NO_AUTO_UPDATE=1
13-
brew install python3
14-
fi
15-
elif [[ $PLATFORM == "Linux" ]]; then
16-
# for AGNOS since we clear the apt lists
17-
if [[ ! -d /"var/lib/apt/" ]]; then
18-
sudo apt update
19-
fi
20-
21-
sudo apt-get install -y --no-install-recommends \
22-
curl ca-certificates \
23-
python3-dev python3-pip python3-venv
24-
else
25-
echo "WARNING: unsupported platform. skipping apt/brew install."
26-
fi
27-
289
# catch2
2910
if [ ! -d $DIR/msgq/catch2/ ]; then
3011
rm -rf /tmp/catch2/ $DIR/msgq/catch2/

0 commit comments

Comments
 (0)