isocpp / isocpp/CppCoreGuidelines

ES.30: Don’t use macros for program text manipulation - example warnings

Open
#2,152 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
CSS
Stars
45.3k
Forks
5.6k
PR merge metrics
No merged PRs in 30d

Description

There is a warning about the unused x,y params in the example - Can those x,y there be removed?

<source>: In function 'void f(int, int)':
<source>:17:12: warning: unused parameter 'x' [-Wunused-parameter]
   17 | void f(int x, int y)
      |        ~~~~^
<source>:17:19: warning: unused parameter 'y' [-Wunused-parameter]
   17 | void f(int x, int y)
      |               ~~~~^

https://godbolt.org/z/hb41sfnsb

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ES.30 example referenced in the issue and compare its compiler output with the linked Godbolt example. Remove the unused x and y parameters if they are not needed, then verify that the example no longer emits those unused-parameter warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.