News for hackers. Stuff that matters.
Re:The C++ standard for the F-35 Fighter Jet [video] by msla on Sunday December 07, 2025 @02:41PM (#46184442)
Especially since there is a widely recognized way to ignore a parameter:

    (void) a;
Every C programmer beyond weaning knows that.
Re:The C++ standard for the F-35 Fighter Jet [video] by time4tea on Sunday December 07, 2025 @03:14PM (#46184723)
The point really was that the unused method parameter should in almost all cases be removed, not that some trick should be used to make it seem used, and this is the wrong trick!
Re:The C++ standard for the F-35 Fighter Jet [video] by addaon on Sunday December 07, 2025 @04:13PM (#46185208)
Sometimes. But sometimes you have a set of functions that are called through function pointers that need the same signature, and one or more of them ignore some of the arguments. These days I’d spell that __attribute__((unused)); but it’s a perfectly reasonable case.
Re:The C++ standard for the F-35 Fighter Jet [video] by bluGill on Monday December 08, 2025 @05:10AM (#46190553)

    #if otherbuild
        dosomething(param);
     #endif
the above type of thing happens once in a while. nos the paramater is needed but the normal build doesn't use it
Re:The C++ standard for the F-35 Fighter Jet [video] by stefan_ on Sunday December 07, 2025 @02:43PM (#46184455)
I'm sure thats disallowed for the C-style cast.
Re:The C++ standard for the F-35 Fighter Jet [video] by daringrain32781 on Sunday December 07, 2025 @02:48PM (#46184512)
C++17 has the [[maybe_unused]] attribute.
Re:The C++ standard for the F-35 Fighter Jet [video] by cpgxiii on Sunday December 07, 2025 @02:57PM (#46184585)
Fwiw, unused-cast-to-void is a case that GCC and Clang ignore when using -Wno-old-style-cast, which is what most projects prohibiting C-style casts are going to be using (or whatever the equivalent their compiler provides).