Skip to content

Remove -Wno-digraphs from clang#32869

Open
peterbarker wants to merge 8 commits intoArduPilot:masterfrom
peterbarker:pr/compiler-warnings
Open

Remove -Wno-digraphs from clang#32869
peterbarker wants to merge 8 commits intoArduPilot:masterfrom
peterbarker:pr/compiler-warnings

Conversation

@peterbarker
Copy link
Copy Markdown
Contributor

Summary

Removes this compiler option as clang doesn't know about it. Also make unknown compiler options fatal as they may actually be important...

Classification & Testing (check all that apply and add your own)

  • Checked by a human programmer
  • Non-functional change
  • No-binary change
  • Infrastructure change (e.g. unit tests, helper scripts)
  • Automated test(s) verify changes (e.g. unit test, autotest)
  • Tested manually, description below (e.g. SITL)
  • Tested on hardware
  • Logs attached
  • Logs available on request
Board                    AP_Periph  antennatracker  blimp  bootloader  copter  heli  iofirmware  plane  rover  sub
CubeOrange-periph-heavy  *                                 *
Durandal                            *               *      *           *       *                 *      *      *
Hitec-Airspeed           *                                 *
KakuteH7-bdshot                     *               *      *           *       *                 *      *      *
MatekF405                           *               *      *           *       *                 *      *      *
MatekH7A3                           *               *      *           *       *                 *      *      *
Pixhawk1-1M-bdshot                  *               *                  *       *                 *      *      *
SITL_x86_64_linux_gnu               *               *                  *       *                 *      *      *
YJUAV_A6SE                          *               *      *           *       *                 *      *      *
f103-QiotekPeriph        *                                 *
f303-MatekGPS            *                                 *
f303-Universal           *                                 *
iomcu                                                                                *
mindpx-v2                           *               *      *           *       *                 *      *      *
revo-mini                           *               *      *           *       *                 *      *      *
skyviper-v2450                                                         *
speedybeef4                         *               *      *           *       *                 *      *      *

... no vast amounts of warnings now for clang

Description

This warning was coming out a lot on clang. Compiles but warns.

Make the warning non-clang only and make future "don't know about this warning" fatal on clang.

@Huibean
Copy link
Copy Markdown
Member

Huibean commented Apr 21, 2026

Thanks Peter, this fix my mac build, but seems like it break the CI

@peterbarker
Copy link
Copy Markdown
Contributor Author

Thanks Peter, this fix my mac build, but seems like it break the CI

Yeah - I've pushed up another pair of patches for that.

I wouldn't be surprised if Plane breaks next on QURT - people were not particularly thorough and fixed only the Copter build for spewing out the warnings for logical-operations vs bitwise-operations...

@peterbarker
Copy link
Copy Markdown
Contributor Author

... and another pair of fixes for frame size warnings...

@peterbarker
Copy link
Copy Markdown
Contributor Author

... and some more fixes for stack sizes and now one for -Wformat-truncation

#if defined(__clang_major__)
// clang doesn't understand -Wformat-truncation
#pragma GCC diagnostic push
#endof
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better add a link to the manual for "#endof"

{ // ensure rest of buffer survives
memset(output, 'A', 10);
//Main loop where the action takes place
#if defined(__clang_major__)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right polarity on this?

@peterbarker
Copy link
Copy Markdown
Contributor Author

Can be merged once claude says it is good

.... and no compiler output (should add clang to size_compare_branches.py somehow?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants