Skip to content

C: a // comment ending in a backslash does not continue onto the next line (line splicing), so the next line leaks into the code stream #9434

Backlog

Description

@squid-protocol

Found by the SOP-002 gap-cell decoy work (protocol SOP-002-v1, epic #8863), batch c (Req A, comment forms).

C11 6.4.9 / 5.1.1.2: a backslash-newline is spliced (phase 2) before comments are recognised, so a // comment ending in \ also comments out the following line. Prism ends the // comment at the newline.

Snippets (each is two lines):

// first \
#include <stdio.h>
// first \
int n = (int) x;
// first \
static int counter = 0;

Expected: import / explicit_casts / globals 0 (the second line is comment text). Actual: 1 each. The same lexer path likely serves cpp and objective-c (not checked here).

Activity

  1. added
    bug
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions