Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress to GCC warning with multi-line comment #2383

Merged
merged 1 commit into from
Apr 8, 2025
Merged

Conversation

hsbt
Copy link
Member

@hsbt hsbt commented Apr 4, 2025

https://rubyci.s3.amazonaws.com/debian11/ruby-master/log/20250404T003003Z.log.html.gz shows compilation warning with main.c.

main.c: In function ‘Init_rbs_extension’:
main.c:24:3: warning: multi-line comment [-Wcomment]
   24 |   // grep -o 'INTERN("\([^"]*\)")' ext/rbs_extension/parser.c \
      |   ^

I replaced that comment with /* */ style. I'm not sure this is good for that.

```
main.c: In function ‘Init_rbs_extension’:
main.c:24:3: warning: multi-line comment [-Wcomment]
   24 |   // grep -o 'INTERN("\([^"]*\)")' ext/rbs_extension/parser.c \
      |   ^
```
@nobu
Copy link
Member

nobu commented Apr 8, 2025

Another solution.
sh (of course also bash) continues to the next line after |, so this command is valid.

grep -o 'INTERN("\([^"]*\)")' ext/rbs_extension/parser.c |
    sed 's/INTERN("\(.*\)")/\1/' |
    sort -u |
    wc -l

Copy link
Member

@soutaro soutaro left a comment

Choose a reason for hiding this comment

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

Thanks! 🎉

@soutaro soutaro added this pull request to the merge queue Apr 8, 2025
@soutaro soutaro added this to the RBS 4.0 milestone Apr 8, 2025
Merged via the queue into master with commit f0c02da Apr 8, 2025
20 checks passed
@soutaro soutaro deleted the remove-gcc-warning branch April 8, 2025 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants