Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.15)
project(miniscript2 LANGUAGES C CXX)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_EXTENSIONS ON) # gnu++11, needed for POSIX extensions
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS ON) # gnu++11, needed for computed-goto

Expand Down
10 changes: 5 additions & 5 deletions cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ else
endif

CXXFLAGS = -std=gnu++11 -Wall -Wextra $(OPT_FLAGS) -Icore -I$(GENDIR) -I. $(GOTO_FLAG) $(EDITLINE_DEFINE) -MMD -MP
CFLAGS = -std=c99 -Wall -Wextra $(OPT_FLAGS) -Icore $(GOTO_FLAG) -MMD -MP
CFLAGS = -std=gnu99 -Wall -Wextra $(OPT_FLAGS) -Icore $(GOTO_FLAG) -MMD -MP

# AddressSanitizer flags for debugging
ASAN_CXXFLAGS = -std=gnu++11 -Wall -Wextra -O0 -g -fsanitize=address -Icore -I$(GENDIR) -I. $(GOTO_FLAG) $(EDITLINE_DEFINE) -MMD -MP
ASAN_CFLAGS = -std=c99 -Wall -Wextra -O0 -g -fsanitize=address -Icore $(GOTO_FLAG) -MMD -MP
ASAN_CFLAGS = -std=gnu99 -Wall -Wextra -O0 -g -fsanitize=address -Icore $(GOTO_FLAG) -MMD -MP
ASAN_LDFLAGS = -fsanitize=address
COREDIR = core
EDITLINEDIR = editline
Expand Down Expand Up @@ -135,7 +135,7 @@ $(OBJDIR)/gen_%.o: $(GENDIR)/%.g.cpp | $(OBJDIR)

# editline C object files (Unix/macOS only)
$(OBJDIR)/editline_%.o: $(EDITLINEDIR)/%.c | $(OBJDIR)
$(CC) -std=c99 -Wall $(OPT_FLAGS) $(EDITLINE_CFLAGS) -c $< -o $@
$(CC) -std=gnu99 -Wall $(OPT_FLAGS) $(EDITLINE_CFLAGS) -c $< -o $@

# ASAN target
$(ASAN_TARGET): $(ASAN_OBJECTS) | $(BUILDDIR)
Expand All @@ -155,7 +155,7 @@ $(ASAN_OBJDIR)/gen_%.o: $(GENDIR)/%.g.cpp | $(ASAN_OBJDIR)

# ASAN editline C object files (Unix/macOS only)
$(ASAN_OBJDIR)/editline_%.o: $(EDITLINEDIR)/%.c | $(ASAN_OBJDIR)
$(CC) -std=c99 -Wall -O0 -g -fsanitize=address $(EDITLINE_CFLAGS) -c $< -o $@
$(CC) -std=gnu99 -Wall -O0 -g -fsanitize=address $(EDITLINE_CFLAGS) -c $< -o $@

$(ASAN_OBJDIR):
mkdir -p $(ASAN_OBJDIR)
Expand All @@ -179,4 +179,4 @@ info:

# Include auto-generated dependency files (the - silently ignores missing files)
-include $(OBJECTS:.o=.d)
-include $(ASAN_OBJECTS:.o=.d)
-include $(ASAN_OBJECTS:.o=.d)
1 change: 1 addition & 0 deletions cpp/core/CS_List.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// as well as possible. Memory management is done via std::shared_ptr and std::vector.

#pragma once
#include <cstdint>
#include <memory>
#include <vector>
#include <initializer_list>
Expand Down