Skip to content

[P3] Unknown preprocessor directives silently ignored — no warning for typos like #defin #172

@ChaseWNorton

Description

@ChaseWNorton

Problem

In `src/frontend/preprocessor/pipeline.rs` (lines 882-889), when a directive keyword is not recognized, CCC silently ignores it. GCC emits a warning for unknown/unsupported directives. Silently ignoring can mask bugs from typos.

```c
#defin FOO 1 // Typo — should be #define
int x = FOO; // FOO is undefined — wrong compilation
// GCC: warning: unknown directive
// CCC: silent
```

Files to modify

  • `src/frontend/preprocessor/pipeline.rs` — Emit a warning for unrecognized directives

Acceptance criteria

  • Unknown directives produce a warning
  • Known directives (`#define`, `#include`, etc.) unaffected
  • `cargo test --lib` passes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions