Skip to content

Commit 902252b

Browse files
author
Javier Gil Aviles
committed
Refs #21358: Change null dereference compilation to test on alternatives build
Signed-off-by: Javier Gil Aviles <javiergil@eprosima.com>
1 parent 0aa97fe commit 902252b

2 files changed

Lines changed: 107 additions & 105 deletions

File tree

.github/workflows/reusable-ubuntu-ci.yml

Lines changed: 107 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ on:
6060

6161
env:
6262
security-cmake-flag: ${{ inputs.security == true && '-DSECURITY=ON' || '-DSECURITY=OFF' }}
63+
colcon-build-default-cmake-args: '-DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wpedantic -Wunused-value -Woverloaded-virtual -Wsign-compare -Wcast-align -Wlogical-op -Wduplicated-cond -Wrestrict -Wpointer-arith -Wwrite-strings -Wunreachable-code"'
6364
defaults:
6465
run:
6566
shell: bash
@@ -73,8 +74,6 @@ jobs:
7374
matrix:
7475
cmake-build-type:
7576
- 'RelWithDebInfo'
76-
env:
77-
colcon-build-default-cmake-args: '-DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wpedantic -Wunused-value -Woverloaded-virtual -Wsign-compare -Wcast-align -Wlogical-op -Wduplicated-cond -Wrestrict -Wnull-dereference -Wpointer-arith -Wwrite-strings -Wunreachable-code"'
7877
steps:
7978
- name: Add ci-pending label if PR
8079
if: ${{ github.event_name == 'pull_request' && inputs.add-label == true }}
@@ -769,85 +768,100 @@ jobs:
769768
path: src/osrf_testing_tools_cpp
770769
ref: 1.4.0
771770

772-
- name: OSRF testing tools build
773-
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
774-
with:
775-
colcon_meta_file: ''
776-
colcon_build_args: ${{ inputs.colcon-args }} --packages-select osrf_testing_tools_cpp
777-
cmake_args: '-DBUILD_TESTING=OFF'
778-
cmake_args_default: ''
779-
cmake_build_type: ${{ matrix.cmake-build-type }}
780-
workspace: ${{ github.workspace }}
781-
782-
- name: Profilling tests build
783-
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
784-
with:
785-
colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_build.meta
786-
colcon_build_args: ${{ inputs.colcon-args }} --packages-up-to fastdds
787-
cmake_args: '-DPROFILING_TESTS=ON ${{ inputs.cmake-args }}'
788-
cmake_args_default: ${{ env.colcon-build-default-cmake-args }}
789-
cmake_build_type: ${{ matrix.cmake-build-type }}
790-
workspace: ${{ github.workspace }}
791-
workspace_dependencies: ${{ github.workspace }}/install
792-
793-
- name: Clean workspace - Profiling tests
794-
run: |
795-
cd ${{ github.workspace }}
796-
rm -rf build install log src/osrf_testing_tools_cpp
797-
798-
- name: No security colcon build
799-
continue-on-error: false
800-
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
801-
with:
802-
colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_build.meta
803-
colcon_build_args: ${{ inputs.colcon-args }}
804-
cmake_args: '-DSECURITY=OFF ${{ inputs.cmake-args }}'
805-
cmake_args_default: ${{ env.colcon-build-default-cmake-args }}
806-
cmake_build_type: ${{ matrix.cmake-build-type }}
807-
workspace: ${{ github.workspace }}
808-
809-
- name: Clean workspace - No security
810-
run: |
811-
cd ${{ github.workspace }}
812-
rm -rf build install log
813-
814-
- name: No statistics colcon build
771+
# - name: OSRF testing tools build
772+
# uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
773+
# with:
774+
# colcon_meta_file: ''
775+
# colcon_build_args: ${{ inputs.colcon-args }} --packages-select osrf_testing_tools_cpp
776+
# cmake_args: '-DBUILD_TESTING=OFF'
777+
# cmake_args_default: ''
778+
# cmake_build_type: ${{ matrix.cmake-build-type }}
779+
# workspace: ${{ github.workspace }}
780+
781+
# - name: Profilling tests build
782+
# uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
783+
# with:
784+
# colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_build.meta
785+
# colcon_build_args: ${{ inputs.colcon-args }} --packages-up-to fastdds
786+
# cmake_args: '-DPROFILING_TESTS=ON ${{ inputs.cmake-args }}'
787+
# cmake_args_default: ${{ env.colcon-build-default-cmake-args }}
788+
# cmake_build_type: ${{ matrix.cmake-build-type }}
789+
# workspace: ${{ github.workspace }}
790+
# workspace_dependencies: ${{ github.workspace }}/install
791+
792+
# - name: Clean workspace - Profiling tests
793+
# run: |
794+
# cd ${{ github.workspace }}
795+
# rm -rf build install log src/osrf_testing_tools_cpp
796+
797+
# - name: No security colcon build
798+
# continue-on-error: false
799+
# uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
800+
# with:
801+
# colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_build.meta
802+
# colcon_build_args: ${{ inputs.colcon-args }}
803+
# cmake_args: '-DSECURITY=OFF ${{ inputs.cmake-args }}'
804+
# cmake_args_default: ${{ env.colcon-build-default-cmake-args }}
805+
# cmake_build_type: ${{ matrix.cmake-build-type }}
806+
# workspace: ${{ github.workspace }}
807+
808+
# - name: Clean workspace - No security
809+
# run: |
810+
# cd ${{ github.workspace }}
811+
# rm -rf build install log
812+
813+
# - name: No statistics colcon build
814+
# uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
815+
# with:
816+
# colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_build.meta
817+
# colcon_build_args: ${{ inputs.colcon-args }}
818+
# cmake_args: '-DFASTDDS_STATISTICS=OFF ${{ env.security-cmake-flag }} ${{ inputs.cmake-args }}'
819+
# cmake_args_default: ${{ env.colcon-build-default-cmake-args }}
820+
# cmake_build_type: ${{ matrix.cmake-build-type }}
821+
# workspace: ${{ github.workspace }}
822+
823+
# - name: Clean workspace - No statistics
824+
# run: |
825+
# cd ${{ github.workspace }}
826+
# rm -rf build install log
827+
828+
# # No .metas file, so FASTDDS_ENFORCE_LOG_INFO is set OFF by default. Missed important args are manually included
829+
# - name: No enforcing log info colcon build
830+
# uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
831+
# with:
832+
# colcon_meta_file: ''
833+
# colcon_build_args: ${{ inputs.colcon-args }}
834+
# cmake_args: '-DCOMPILE_EXAMPLES=ON ${{ env.security-cmake-flag }} ${{ inputs.cmake-args }}'
835+
# cmake_args_default: ${{ env.colcon-build-default-cmake-args }}
836+
# cmake_build_type: ${{ matrix.cmake-build-type }}
837+
# workspace: ${{ github.workspace }}
838+
839+
# - name: Clean workspace - No enforce log info
840+
# run: |
841+
# cd ${{ github.workspace }}
842+
# rm -rf build install log
843+
844+
# - name: No shared libs colcon build
845+
# uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
846+
# with:
847+
# colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_build.meta
848+
# colcon_build_args: ${{ inputs.colcon-args }}
849+
# cmake_args: '-DBUILD_SHARED_LIBS=OFF ${{ env.security-cmake-flag }} ${{ inputs.cmake-args }}'
850+
# cmake_args_default: ${{ env.colcon-build-default-cmake-args }}
851+
# cmake_build_type: ${{ matrix.cmake-build-type }}
852+
# workspace: ${{ github.workspace }}
853+
854+
# - name: Clean workspace - No shared libs
855+
# run: |
856+
# cd ${{ github.workspace }}
857+
# rm -rf build install log
858+
859+
- name: Null dereference colcon build
815860
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
816861
with:
817862
colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_build.meta
818863
colcon_build_args: ${{ inputs.colcon-args }}
819-
cmake_args: '-DFASTDDS_STATISTICS=OFF ${{ env.security-cmake-flag }} ${{ inputs.cmake-args }}'
820-
cmake_args_default: ${{ env.colcon-build-default-cmake-args }}
821-
cmake_build_type: ${{ matrix.cmake-build-type }}
822-
workspace: ${{ github.workspace }}
823-
824-
- name: Clean workspace - No statistics
825-
run: |
826-
cd ${{ github.workspace }}
827-
rm -rf build install log
828-
829-
# No .metas file, so FASTDDS_ENFORCE_LOG_INFO is set OFF by default. Missed important args are manually included
830-
- name: No enforcing log info colcon build
831-
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
832-
with:
833-
colcon_meta_file: ''
834-
colcon_build_args: ${{ inputs.colcon-args }}
835-
cmake_args: '-DCOMPILE_EXAMPLES=ON ${{ env.security-cmake-flag }} ${{ inputs.cmake-args }}'
836-
cmake_args_default: ${{ env.colcon-build-default-cmake-args }}
837-
cmake_build_type: ${{ matrix.cmake-build-type }}
838-
workspace: ${{ github.workspace }}
839-
840-
- name: Clean workspace - No enforce log info
841-
run: |
842-
cd ${{ github.workspace }}
843-
rm -rf build install log
844-
845-
- name: No shared libs colcon build
846-
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
847-
with:
848-
colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_build.meta
849-
colcon_build_args: ${{ inputs.colcon-args }}
850-
cmake_args: '-DBUILD_SHARED_LIBS=OFF ${{ env.security-cmake-flag }} ${{ inputs.cmake-args }}'
864+
cmake_args: '-DCMAKE_CXX_FLAGS="-Wnull-dereference" ${{ env.security-cmake-flag }} ${{ inputs.cmake-args }}'
851865
cmake_args_default: ${{ env.colcon-build-default-cmake-args }}
852866
cmake_build_type: ${{ matrix.cmake-build-type }}
853867
workspace: ${{ github.workspace }}
@@ -857,19 +871,19 @@ jobs:
857871
cd ${{ github.workspace }}
858872
rm -rf build install log
859873
860-
- name: Vanilla colcon build
861-
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
862-
with:
863-
cmake_build_type: ${{ matrix.cmake-build-type }}
864-
workspace: ${{ github.workspace }}
865-
866-
- name: Clean workspace - Vanilla build
867-
run: |
868-
cd ${{ github.workspace }}
869-
rm -rf build install log
870-
871-
- name: GCC latest colcon build
872-
run: |
873-
cd ${{ github.workspace }}/src/fastdds/.github/workflows/docker/ubuntu/alternative_builds
874-
docker build -t fastdds_gcc_latest -f fastdds_gcc_latest.Dockerfile .
875-
docker run --rm -v ${{ github.workspace }}:/root fastdds_gcc_latest
874+
# - name: Vanilla colcon build
875+
# uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
876+
# with:
877+
# cmake_build_type: ${{ matrix.cmake-build-type }}
878+
# workspace: ${{ github.workspace }}
879+
880+
# - name: Clean workspace - Vanilla build
881+
# run: |
882+
# cd ${{ github.workspace }}
883+
# rm -rf build install log
884+
885+
# - name: GCC latest colcon build
886+
# run: |
887+
# cd ${{ github.workspace }}/src/fastdds/.github/workflows/docker/ubuntu/alternative_builds
888+
# docker build -t fastdds_gcc_latest -f fastdds_gcc_latest.Dockerfile .
889+
# docker run --rm -v ${{ github.workspace }}:/root fastdds_gcc_latest

thirdparty/optionparser/optionparser/optionparser.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -770,23 +770,11 @@ class Option
770770
* @code for (Option* opt = options[FILE]; opt; opt = opt->next())
771771
* fname = opt->arg; ... @endcode
772772
*/
773-
#ifndef _MSC_VER
774-
#pragma GCC diagnostic push
775-
#pragma GCC diagnostic ignored "-Wnull-dereference"
776-
#pragma clang diagnostic push
777-
#pragma clang diagnostic ignored "-Wnull-dereference"
778-
#endif
779-
780773
operator Option*()
781774
{
782775
return desc ? this : 0;
783776
}
784777

785-
#ifndef _MSC_VER
786-
#pragma clang diagnostic pop
787-
#pragma GCC diagnostic pop
788-
#endif
789-
790778
/**
791779
* @brief Creates a new Option that is a one-element linked list and has NULL
792780
* @ref desc, @ref name, @ref arg and @ref namelen.

0 commit comments

Comments
 (0)