Skip to content

Conversation

@biergaizi
Copy link
Contributor

@biergaizi biergaizi commented Dec 6, 2025

Introduction

A constant flood of warnings is harmful, even if the warnings are safe to ignore, because they would mask useful warnings in the future (a real bug has indeed been found, a separate discussion is needed, see #75). This Pull Request fix several compiler warnings.

src/ParameterObjects.cpp: remove unused "dHelp"

ParameterObjects.cpp:27:9: warning: unused variable 'dHelp' [-Wunused-variable]
   27 |         double dHelp;
      |                ^~~~~
1 warning generated.

src/CSPrimitives.cpp: add a fallthrough comment in CoordInRange

If Wimplicit-fallthrough (part of -Wextra) is enabled, GCC requires fallthrough switch/case to explicitly marked with a compiler intrinsic or a text comment. Mark Cylindrical coordinate preprocessing with a fallthrough comment.

/home/fdtd/CSXCAD/src/CSPrimitives.cpp: In function ‘bool CoordInRange(const double*, const double*, const double*, CoordinateSystem)’:
/home/fdtd/CSXCAD/src/CSPrimitives.cpp:60:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
   60 |                 if (p[1]<std::min(start[1],stop[1]))
      |                 ^~
/home/fdtd/CSXCAD/src/CSPrimitives.cpp:66:9: note: here
   66 |         case CARTESIAN:
      |         ^~~~

src/CSPrimPolyhedron_p.h: fix CGAL 6 deprecation

The header AABB_traits.h is now deprecated in CGAL v6. More to AABB_traits_6.h for CGAL v6+.

In file included from /usr/include/CGAL/AABB_traits.h:19,
                 from /home/fdtd/CSXCAD/src/CSPrimPolyhedron_p.h:10,
                 from /home/fdtd/CSXCAD/src/CSPrimPolyhedron.cpp:25:
/usr/include/CGAL/Installation/internal/deprecation_warning.h:80:6: warning: #warning "A deprecated header has been included." [-Wcpp]
   80 | #    warning "A deprecated header has been included."
      |      ^~~~~~~

CI: Enable compiler warnings, use actions/checkout for FreeBSD

Use GitHub Actions actions/checkout to fetch source code on FreeBSD instead of manually launching git. Also, enable compiler warnings via CXXFLAGS on all platforms.

@biergaizi biergaizi marked this pull request as draft December 6, 2025 10:07
@biergaizi biergaizi force-pushed the fix-warnings branch 2 times, most recently from 87b29ad to ccdbedd Compare December 6, 2025 10:23
@biergaizi biergaizi changed the title Fix Several Compiler Warnings, and Optimize CI on FreeBSD Fix Several Compiler Warnings, and Optimize CI scripts Dec 6, 2025
@biergaizi
Copy link
Contributor Author

Merge ready.

@biergaizi biergaizi marked this pull request as ready for review December 6, 2025 10:35
    ParameterObjects.cpp:27:9: warning: unused variable 'dHelp' [-Wunused-variable]
       27 |         double dHelp;
          |                ^~~~~
    1 warning generated.

Signed-off-by: Yifeng Li <tomli@tomli.me>
If "Wimplicit-fallthrough" (part of "-Wextra") is enabled, GCC
requires fallthrough switch/case to explicitly marked with a
compiler intrinsic or a text comment. Mark Cylindrical coordinate
preprocessing with a fallthrough comment.

    /home/fdtd/CSXCAD/src/CSPrimitives.cpp: In function ‘bool CoordInRange(const double*, const double*, const double*, CoordinateSystem)’:
    /home/fdtd/CSXCAD/src/CSPrimitives.cpp:60:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
       60 |                 if (p[1]<std::min(start[1],stop[1]))
          |                 ^~
    /home/fdtd/CSXCAD/src/CSPrimitives.cpp:66:9: note: here
       66 |         case CARTESIAN:
          |         ^~~~

Signed-off-by: Yifeng Li <tomli@tomli.me>
The header `AABB_traits.h` is now deprecated in CGAL v6.
More to `AABB_traits_6.h` for CGAL v6+.

    In file included from /usr/include/CGAL/AABB_traits.h:19,
                     from /home/fdtd/CSXCAD/src/CSPrimPolyhedron_p.h:10,
                     from /home/fdtd/CSXCAD/src/CSPrimPolyhedron.cpp:25:
    /usr/include/CGAL/Installation/internal/deprecation_warning.h:80:6: warning: #warning "A deprecated header has been included." [-Wcpp]
       80 | #    warning "A deprecated header has been included."
          |      ^~~~~~~

Signed-off-by: Yifeng Li <tomli@tomli.me>
Use GitHub Actions "actions/checkout" to fetch source code
on FreeBSD instead of manually launching git. Also, enable
compiler warnings via CXXFLAGS on all platforms.

Signed-off-by: Yifeng Li <tomli@tomli.me>
@biergaizi
Copy link
Contributor Author

Hello, can this Pull Request be merged now?

@thliebig
Copy link
Owner

okay missed these...

@thliebig thliebig merged commit e3fb718 into thliebig:master Dec 10, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants