Skip to content

when main is not empty, compiler bot chokes on string literal #162

@abcq2

Description

@abcq2

examples

string literal in initialiser

#include "stdio.h"
int x = sizeof "" + '0';
int main() {
  printf("%d\n", x); 
}

string literal in comment

#include "stdio.h"
// ""
int main() {
  printf("x"); 
}

counterexample

no string literal

#include "stdio.h"
#define NARF void
#define ZORT signed
int x = '1';
ZORT main (NARF) {
  printf("%d\n", x); 
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions