nomp-org / nomp-org/libnomp

Fix warning due to usage of GNU extension `##__VA_ARGS__`

Open
#226 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
Dominant language
C
Stars
17
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Currently, the only warning I see when building libnomp is the following:

In file included from /Users/thili/Repos/nomp-org/libnomp/src/nomp.c:1:
In file included from /Users/thili/Repos/nomp-org/libnomp/include/nomp-impl.h:26:
/Users/thili/Repos/nomp-org/libnomp/include/nomp-log.h:51:52: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
  nomp_log_(desc, logno, type, __FILE__, __LINE__, ##__VA_ARGS__)

This is due to the usage of ##__VA_ARGS__ which is a GNU extension (although widely supported by different compilers).

Once this is fixed, we should treat warnings as errors in CMakeLists.txt:

set(CMAKE_COMPILE_WARNING_AS_ERROR ON)

Contributor guide

No contributing guide indexed for this repository

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 by inspecting the variadic logging macro in include/nomp-log.h and the warning configuration in CMakeLists.txt. Build libnomp with the relevant compiler warnings enabled; done means the GNU variadic-macro warning is gone and warnings are treated as errors through the requested CMake setting.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cmake
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.