C89 compliance items#10858
Open
anhu wants to merge 6 commits into
Open
Conversation
- Flexible array members ("type name[];") fixup
- avoid empty asn_orig.c when building standalone
- avoid trailing comma on the last enumerator
- drop some consts to match function prototypes
|
douzzer
requested changes
Jul 7, 2026
dgarske
previously approved these changes
Jul 8, 2026
douzzer
requested changes
Jul 8, 2026
Comment on lines
+224
to
+231
| #if defined(WOLF_C89) | ||
| /* C99 flexible array member, or the C89 "struct hack" fallback. | ||
| * See http://c-faq.com/struct/structhack.html */ | ||
| #define WC_FLEXIBLE_ARRAY_MEMBER 1 | ||
| #else | ||
| /* empty: C99 flexible array member */ | ||
| #define WC_FLEXIBLE_ARRAY_MEMBER | ||
| #endif |
Contributor
There was a problem hiding this comment.
This needs to be named WC_FLEXIBLE_ARRAY_SIZE. It also needs override capability. The setup for it in WolfSentry is
#if defined(WOLFSENTRY_FLEXIBLE_ARRAY_SIZE)
/* keep override value. */
#elif defined(__STRICT_ANSI__) || defined(WOLFSENTRY_PEDANTIC_C)
#define WOLFSENTRY_FLEXIBLE_ARRAY_SIZE 1
#elif defined(__GNUC__) && !defined(__clang__)
#define WOLFSENTRY_FLEXIBLE_ARRAY_SIZE
/*!< \brief Value appropriate as a size for an array that will be allocated to a variable size. Built-in value usually works. */
#else
#define WOLFSENTRY_FLEXIBLE_ARRAY_SIZE 0
#endif
and that's my recommendation here too, with || defined(WOLF_C89) added to the __STRICT_ANSI__ condition.
douzzer
previously approved these changes
Jul 8, 2026
douzzer
left a comment
Contributor
There was a problem hiding this comment.
Note a whitespace flub in the reindented comments in the struct ExternalTicket definition -- but def not worth holding up the PR for it.
Member
Author
|
Fixed the whitespace. |
douzzer
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes ZD 22098