microsoft / microsoft/DirectXShaderCompiler

DXC doesn't compile with `/Zc:preprocessor` (the new MSVC C++ conformant preprocessor)

Open
#7,042 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug build
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

Description

DXC doesn't compile with /Zc:preprocessor build flag using MSVC.

This may explain some of our issues when trying to compile DXC with vanilla Clang (without using MSVC runtime) instead of MSVC.

Steps to Reproduce

DXC doesn't compile with /Zc:preprocessor build flag using MSVC.

Actual Behavior

Errors around the use-site of DXASSERT, its probably __VA_ARGS__ not removing the , before itself when the va-args are empty.

Environment

  • DXC version: latest trunk
  • Host Operating System: Windows

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 building DXC on Windows with MSVC and the /Zc:preprocessor flag, then inspect the DXASSERT use sites reported by the compiler. Check how empty VA_ARGS is handled and consider vanilla Clang compatibility; done means DXC compiles successfully with the flag.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.