mesonbuild / mesonbuild/meson

compiler.get_supported_arguments reports success for unsupported flags

Open
#5,355 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug compilers good first issue
Dominant language
Python
Stars
6.6k
Forks
1.9k
Avg merge
2d 6h
Merged PRs (30d)
33

Description

The has_argument and get_supported_argument methods are reporting success when the compiler returns an unsupported flag error to stderr.

I have attached a simple test case which demonstrates the error. The relevant meson.log entry is

Running compile:
Working directory:  /tmp/tmpygkykj04
Command line:  c++ /tmp/tmpygkykj04/testfile.cpp -pipe -D_FILE_OFFSET_BITS=64 -c -o /tmp/tmpygkykj04/output.obj -O0 -fpermissive -Wdeclaration-after-statement 

Code:
 int i;

Compiler stdout:
 
Compiler stderr:
 cc1plus: warning: command line option '-Wdeclaration-after-statement' is valid for C/ObjC but not for C++

Compiler for C++ supports arguments -Wdeclaration-after-statement: YES

meson.build.txt

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 by locating the implementations of compiler.get_supported_argument and has_argument, then reproduce the attached test case and inspect the corresponding meson.log output. Done means a compiler response reporting the flag as unsupported is no longer reported as supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.