Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Suppress unnecessary GCC truncation warnings using compiler directives #191

Closed
wants to merge 2 commits into from

Conversation

AarC10
Copy link
Contributor

@AarC10 AarC10 commented Feb 1, 2024

#190 - Stop GCC from complaining in general about truncation issues using GCC compiler directives. This means that older GCC compilers will not get a warning. Tested on zephyr's eabi-gcc compiler which is on version 12.2

Unsure on whether or not we should remove the ignored variable and void cast now.

@RobMeades
Copy link
Contributor

RobMeades commented Feb 1, 2024

Hi, thanks for this. It's a shame that the non-#pramga removal mechanism doesn't work for your version of GCC; we usually try to avoid #pragma's because of the tendency of some compilers to emit an unknown #pragma, warning but I've run your PR through the test system and it doesn't appear to cause that on any of the compilers we currently support.

You will see from the All checks have failed red thingy that there's an AStyle issue in common/at_client/src/u_at_client.c:

image

If you could maybe fix that and re-push then I'll take your change internally, apply it and push it back to master here?

EDIT:

Unsure on whether or not we should remove the ignored variable and void cast now.

I think leave those in as that's the preferred mechanism that we may be able to move to at some point in the future.

@RobMeades
Copy link
Contributor

Oh, and when you re-push you could change Supress -> Suppress also.

@AarC10 AarC10 changed the title Supress unnecessary GCC truncation warnings using compiler directives Suppress unnecessary GCC truncation warnings using compiler directives Feb 1, 2024
@AarC10 AarC10 closed this Feb 1, 2024
@AarC10 AarC10 deleted the supress_gcc_snprintf_warnings branch February 1, 2024 20:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants