Skip to content

Commit

Permalink
Repair snippets CI again
Browse files Browse the repository at this point in the history
  • Loading branch information
ckormanyos committed Oct 27, 2023
1 parent 7e5996b commit 611d5de
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code_snippets/appendix0a/appendix0a_15-004_type_traits.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright Christopher Kormanyos 2019.
// Copyright Christopher Kormanyos 2019 - 2023.
// Distributed under the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
//

// appendix0a_15-004_type_traits.cpp

#include <cstdint>
#include <iomanip>
#include <iostream>
#include <type_traits>
Expand Down
45 changes: 45 additions & 0 deletions code_snippets/chapter03/chapter03.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ $GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -O3 -m64 -fsanitize=address -fsa
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum ./chapter03_11-001_array.cpp -o ./bin/chapter03_11-001_array.exe
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum ./chapter03_12-001_basic_stl.cpp -o ./bin/chapter03_12-001_basic_stl.exe
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum ./chapter03_13-001_basic_stl_numeric.cpp -o ./bin/chapter03_13-001_basic_stl_numeric.exe
if [[ "$GCC" == "g++" ]]; then
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum ./chapter03_14-001_atomic_operations.cpp -o ./bin/chapter03_14-001_atomic_operations.exe
fi
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum ./chapter03_15-001_digit_separators.cpp -o ./bin/chapter03_15-001_digit_separators.exe
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum ./chapter03_15-002_digit_separators.cpp -o ./bin/chapter03_15-002_digit_separators.exe
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum ./chapter03_16-001_binary_literals.cpp -o ./bin/chapter03_16-001_binary_literals.exe
Expand All @@ -65,6 +67,7 @@ $GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -O3 -m64 -fsanitize=address -fsa
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum ./chapter03_22-001_mersenne_twister_19937.cpp -o ./bin/chapter03_22-001_mersenne_twister_19937.exe
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum ./chapter03_22-002_test_random_engines.cpp -o ./bin/chapter03_22-002_test_random_engines.exe

if [[ "$GCC" == "g++" ]]; then
ls -la \
./bin/chapter03_01-001_declare_locals.exe \
./bin/chapter03_02-001_fixed_size_integer.exe \
Expand Down Expand Up @@ -106,6 +109,48 @@ ls -la \
./bin/chapter03_21-001_span.exe \
./bin/chapter03_22-001_mersenne_twister_19937.exe \
./bin/chapter03_22-002_test_random_engines.exe
else
ls -la \
./bin/chapter03_01-001_declare_locals.exe \
./bin/chapter03_02-001_fixed_size_integer.exe \
./bin/chapter03_02-002_prime_number.exe \
./bin/chapter03_02-002a_explore_prime_numbers.exe \
./bin/chapter03_03-001_bool_type.exe \
./bin/chapter03_04-001_namespaces.exe \
./bin/chapter03_04-002_anonymous_namespace.exe \
./bin/chapter03_04-003_nested_namespace.exe \
./bin/chapter03_05-001_basic_classes.exe \
./bin/chapter03_06-001_basic_templates_add.exe \
./bin/chapter03_06-002_basic_templates_xy_point.exe \
./bin/chapter03_07-001_nullptr.exe \
./bin/chapter03_08-001_constexpr.exe \
./bin/chapter03_08-002_constexpr_more.exe \
./bin/chapter03_08-003_constexpr_pown.exe \
./bin/chapter03_09-001_static_assert.exe \
./bin/chapter03_10-001_limits.exe \
./bin/chapter03_11-001_array.exe \
./bin/chapter03_12-001_basic_stl.exe \
./bin/chapter03_13-001_basic_stl_numeric.exe \
./bin/chapter03_15-001_digit_separators.exe \
./bin/chapter03_15-002_digit_separators.exe \
./bin/chapter03_16-001_binary_literals.exe \
./bin/chapter03_16-002_binary_literals.exe \
./bin/chapter03_17-001_user_defined_literals.exe \
./bin/chapter03_17-002_user_defined_literals.exe \
./bin/chapter03_17-003_user_defined_literals.exe \
./bin/chapter03_17-004_user_defined_literals.exe \
./bin/chapter03_17-005_user_defined_literals.exe \
./bin/chapter03_17-006_user_defined_literals.exe \
./bin/chapter03_18-001_alignment.exe \
./bin/chapter03_18-002_alignment.exe \
./bin/chapter03_19-001_final.exe \
./bin/chapter03_19-002_final.exe \
./bin/chapter03_20-001_alias.exe \
./bin/chapter03_20-002_alias.exe \
./bin/chapter03_21-001_span.exe \
./bin/chapter03_22-001_mersenne_twister_19937.exe \
./bin/chapter03_22-002_test_random_engines.exe
fi

result_ls=$?

Expand Down
13 changes: 13 additions & 0 deletions code_snippets/chapter04/chapter04.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ $GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -O3 -m64 -fsanitize=address -fsa
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum ./chapter04_07-001_led_hierarchy_uses_pwm.cpp -o ./bin/chapter04_07-001_led_hierarchy_uses_pwm.exe
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum ./chapter04_08-001_const_com_class.cpp -o ./bin/chapter04_08-001_const_com_class.exe
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum ./chapter04_08-002_nonconst_com_class.cpp -o ./bin/chapter04_08-002_nonconst_com_class.exe
if [[ "$GCC" == "g++" ]]; then
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum ./chapter04_08-003_poll_communication.cpp -o ./bin/chapter04_08-003_poll_communication.exe
fi


if [[ "$GCC" == "g++" ]]; then
ls -la \
./bin/chapter04_01-001_led_hierarchy.exe \
./bin/chapter04_04-001_dynamic_polymorphism.exe \
Expand All @@ -43,6 +46,16 @@ ls -la \
./bin/chapter04_08-001_const_com_class.exe \
./bin/chapter04_08-002_nonconst_com_class.exe \
./bin/chapter04_08-003_poll_communication.exe
else
ls -la \
./bin/chapter04_01-001_led_hierarchy.exe \
./bin/chapter04_04-001_dynamic_polymorphism.exe \
./bin/chapter04_04-002_dynamic_polymorphism_cast.exe \
./bin/chapter04_04-003_dynamic_polymorphism_ref.exe \
./bin/chapter04_07-001_led_hierarchy_uses_pwm.exe \
./bin/chapter04_08-001_const_com_class.exe \
./bin/chapter04_08-002_nonconst_com_class.exe
fi

result_all=$?

Expand Down
31 changes: 31 additions & 0 deletions code_snippets/chapter06/chapter06.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ $GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -Wconversion -Wsign-conversion
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -Wconversion -Wsign-conversion -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum ./chapter06_14-003_romable_initializer_list.cpp -o ./bin/chapter06_14-003_romable_initializer_list.exe
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -Wconversion -Wsign-conversion -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum ./chapter06_14-004_container_initializer_list.cpp -o ./bin/chapter06_14-004_container_initializer_list.exe
$GCC -std=c++20 -Wall -Wextra -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum -I../../../boost-root ./chapter06_14-005_iterator_facade.cpp -o ./bin/chapter06_14-005_iterator_facade.exe
if [[ "$GCC" == "g++" ]]; then
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -Wconversion -Wsign-conversion -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum -pthread -lpthread ./chapter06_15-001_minimize_interrupt_frame.cpp -o ./bin/chapter06_15-001_minimize_interrupt_frame.exe
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -Wconversion -Wsign-conversion -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum -pthread -lpthread ./chapter06_15-002_minimize_interrupt_frame.cpp -o ./bin/chapter06_15-002_minimize_interrupt_frame.exe
fi
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -Wconversion -Wsign-conversion -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum ./chapter06_16-001_operator_new.cpp -o ./bin/chapter06_16-001_operator_new.exe
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -Wconversion -Wsign-conversion -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum ./chapter06_17-001_use_the_stl.cpp -o ./bin/chapter06_17-001_use_the_stl.exe
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -Wconversion -Wsign-conversion -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum ./chapter06_17-002_use_the_stl.cpp -o ./bin/chapter06_17-002_use_the_stl.exe
Expand All @@ -53,6 +55,7 @@ $GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -Wconversion -Wsign-conversion
$GCC -std=$STD -Wall -Wextra -Wpedantic -Werror -Wconversion -Wsign-conversion -O3 -m64 -fsanitize=address -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum ./chapter06_21-001_rtti_typeinfo.cpp -o ./bin/chapter06_21-001_rtti_typeinfo.exe


if [[ "$GCC" == "g++" ]]; then
ls -la \
./bin/chapter06_01-001_crc32_mpeg2.exe \
./bin/chapter06_03-001_mul_16x16to32.exe \
Expand Down Expand Up @@ -81,6 +84,34 @@ ls -la \
./bin/chapter06_18-001_use_lambdas.exe \
./bin/chapter06_18-002_use_lambdas.exe \
./bin/chapter06_21-001_rtti_typeinfo.exe
else
ls -la \
./bin/chapter06_01-001_crc32_mpeg2.exe \
./bin/chapter06_03-001_mul_16x16to32.exe \
./bin/chapter06_06-001_name_mangling.exe \
./bin/chapter06_06-002_name_mangling_get_event.exe \
./bin/chapter06_07-001_assembly_sequences.exe \
./bin/chapter06_08-001_comments.exe \
./bin/chapter06_09-001_typedef_reg_access.exe \
./bin/chapter06_09-002_typedef_led_template.exe \
./bin/chapter06_09-003_alias_reg_access.exe \
./bin/chapter06_10-001_checksum_uint8_t.exe \
./bin/chapter06_10-002_checksum_uint_fast8_t.exe \
./bin/chapter06_11-001_scale_with_powers_of_two.exe \
./bin/chapter06_12-001_mul_shift_and_add.exe \
./bin/chapter06_13-001_adc_dimensioning.exe \
./bin/chapter06_14-001_romable_string.exe \
./bin/chapter06_14-002_romable_array.exe \
./bin/chapter06_14-003_romable_initializer_list.exe \
./bin/chapter06_14-004_container_initializer_list.exe \
./bin/chapter06_14-005_iterator_facade.exe \
./bin/chapter06_16-001_operator_new.exe \
./bin/chapter06_17-001_use_the_stl.exe \
./bin/chapter06_17-002_use_the_stl.exe \
./bin/chapter06_18-001_use_lambdas.exe \
./bin/chapter06_18-002_use_lambdas.exe \
./bin/chapter06_21-001_rtti_typeinfo.exe
fi

result_ls=$?

Expand Down
1 change: 1 addition & 0 deletions code_snippets/chapter06/chapter06_17-001_use_the_stl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// chapter06_17-001_use_the_stl.cpp

#include <array>
#include <cstdint>
#include <iomanip>
#include <iostream>
#include <numeric>
Expand Down
1 change: 1 addition & 0 deletions code_snippets/chapter06/chapter06_17-002_use_the_stl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// chapter06_17-002_use_the_stl.cpp

#include <array>
#include <cstdint>
#include <iomanip>
#include <iostream>
#include <numeric>
Expand Down
1 change: 1 addition & 0 deletions code_snippets/chapter06/chapter06_21-001_rtti_typeinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

// chapter06_21-001_rtti_typeinfo.cpp

#include <cstdint>
#include <cstring>
#include <iostream>
#include <typeinfo>
Expand Down

0 comments on commit 611d5de

Please sign in to comment.