ISO C comments fix

This commit is contained in:
William S Fulton 2022-08-04 07:51:20 +01:00
commit 15a9ce36f8
2 changed files with 6 additions and 6 deletions

View file

@ -6854,11 +6854,11 @@ exprcompound : expr PLUS expr {
} }
| expr LESSEQUALGREATER expr { | expr LESSEQUALGREATER expr {
$$.val = NewStringf("%s <=> %s", COMPOUND_EXPR_VAL($1), COMPOUND_EXPR_VAL($3)); $$.val = NewStringf("%s <=> %s", COMPOUND_EXPR_VAL($1), COMPOUND_EXPR_VAL($3));
// Really `<=>` returns one of `std::strong_ordering`, /* Really `<=>` returns one of `std::strong_ordering`,
// `std::partial_ordering` or `std::weak_ordering`, but we * `std::partial_ordering` or `std::weak_ordering`, but we
// fake it by treating the return value as `int`. The main * fake it by treating the return value as `int`. The main
// thing to do with the return value in this context is to * thing to do with the return value in this context is to
// compare it with 0, for which `int` does the job. * compare it with 0, for which `int` does the job. */
$$.type = T_INT; $$.type = T_INT;
} }
| expr QUESTIONMARK expr COLON expr %prec QUESTIONMARK { | expr QUESTIONMARK expr COLON expr %prec QUESTIONMARK {

View file

@ -324,7 +324,7 @@ int Preprocessor_expr(DOH *s, int *error) {
/* A number. Reduce EXPR_TOP to an EXPR_VALUE */ /* A number. Reduce EXPR_TOP to an EXPR_VALUE */
char *c = Char(Scanner_text(scan)); char *c = Char(Scanner_text(scan));
if (c[0] == '0' && (c[1] == 'b' || c[1] == 'B')) { if (c[0] == '0' && (c[1] == 'b' || c[1] == 'B')) {
// strtol() doesn't handle binary constants. /* strtol() doesn't handle binary constants */
stack[sp].value = (long) strtol(c + 2, 0, 2); stack[sp].value = (long) strtol(c + 2, 0, 2);
} else { } else {
stack[sp].value = (long) strtol(c, 0, 0); stack[sp].value = (long) strtol(c, 0, 0);