Skip to content

Wrap some multi-line macros in do { ... } while(0) in symtable.c #119981

Closed

Description

@picnixz

Feature or enhancement

Proposal:

While I was implementing #119976, I observed that some macros are not guarded against possible constructions because their content is only wrapped in {} but not in the classical do { ... } while(0) construction.

For instance, the current VISIT macro sometimes requires the semi-colon and sometimes not depending on how it is used, which I find a bit confusing. I think it's preferrable to always require to add the ;.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

Activity

  1. added a commit that references this issue on Jun 3, 2024
  2. sobolevn commented on Jun 3, 2024

    @sobolevn
    Member

    There are similar patterns in compile.c, maybe it is also worth taking a look? 🤔

  3. picnixz commented on Jun 3, 2024

    @picnixz
    MemberAuthor

    Yes, that's a good idea. Since I was going offline in a few minutes, could you either close this issue or edit the title so that we can perhaps track other files?

  4. sobolevn commented on Jun 3, 2024

    @sobolevn
    Member

    I prefer to open new ones for each piece of work :)
    Thanks again!

  5. added a commit that references this issue on Jun 3, 2024
  6. added a commit that references this issue on Jun 5, 2024
  7. added a commit that references this issue on Jul 11, 2024
  8. added a commit that references this issue on Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions