Skip to content

some preprocessor directives do not handle comments properly #507

Description

@firewave

The test is unconditionally removing all comments (addressed in #506) leading to tests which test the behavior of such not actually testing it since they did not materialize in the token list.

Affected tests:
has_include_2
missingHeader4

It also affects the #line lineno preprocessor handling.

Activity

  1. self-assigned this
    on Aug 23, 2025
  2. changed the title [-]comments are not properly handled in all preprocessor directives[/-] [+]some preprocessor directives do not handle comments properly[/+] on Aug 26, 2025
  3. firewave commented on Sep 12, 2025

    @firewave
    CollaboratorAuthor
    /**/#/**/if/**/0/**/
    #error "if"
    #endif
    
    #if 0
    #error "endif"
    #/**/endif
    
    /**/#/**/define/**/DEF_1/**/
    #ifndef DEF_1
    #error "DEF_1"
    #endif
    
    /**/#/**/define/**/DEF_2/**/1/**/
    #if !DEF_2
    #error "DEF_2"
    #endif
    
    #define DEF_3
    /**/#/**/if/**/!/**/defined/**/(/**/DEF_3/**/)/**/
    #error "DEF_3"
    #endif
    
    /**/#/**/3/**/
    /**/#/**/3/**/"test.c"/**/
    /**/#/**/line/**/3/**/
    /**/#/**/line/**/3/**/"test.c"/**/
    
    /**/#/**/pragma/**/once/**/
    
    /**/#/**/include/**/<string>/**/
    /**/#/**/include/**/"simplecpp.h"/**/
  4. added 5 commits that reference this issue on Nov 5, 2025
  5. added 3 commits that reference this issue on Nov 29, 2025
  6. added a commit that references this issue on Dec 9, 2025
  7. added a commit that references this issue on May 27, 2026
  8. added 3 commits that reference this issue on Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions