Skip to content

Suppress to GCC warning with multi-line comment#2383

Merged
soutaro merged 1 commit into
masterfrom
remove-gcc-warning
Apr 8, 2025
Merged

Suppress to GCC warning with multi-line comment#2383
soutaro merged 1 commit into
masterfrom
remove-gcc-warning

Conversation

@hsbt

@hsbt hsbt commented Apr 4, 2025

Copy link
Copy Markdown
Member

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

nobu commented Apr 8, 2025

Copy link
Copy Markdown
Member

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

@soutaro soutaro left a comment

Copy link
Copy Markdown
Member

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
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants