Skip to content

Add CI env for C++ and fix errors and warnings when compiling as C++ - #465

Merged
yui-knk merged 10 commits into
ruby:masterfrom
ydah:cpp-ci
Aug 29, 2024
Merged

Add CI env for C++ and fix errors and warnings when compiling as C++#465
yui-knk merged 10 commits into
ruby:masterfrom
ydah:cpp-ci

Conversation

@ydah

@ydah ydah commented Aug 9, 2024

Copy link
Copy Markdown
Member

follow up: #447
fix: #442

yui-knk and others added 8 commits August 8, 2024 19:11
This is a follow up of ruby#443
… this behavior is deprecated [-Wdeprecated]

```
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
```
…onst code_location_t' (aka 'const code_location') without a user-provided default constructor

```
..../var/folders/7d/3dfz8sj91zjdmmzwzz1pw84r0000gp/T/named_references.cpp:1222:22: error: default initialization of an object of const type 'const code_location_t' (aka 'const code_location') without a user-provided default constructor
static const YYLTYPE yyloc_default
                     ^
                                   = {}
1 error generated.
F/var/folders/7d/3dfz8sj91zjdmmzwzz1pw84r0000gp/T/typed_midrule_actions.cpp:1222:22: error: default initialization of an object of const type 'const code_location_t' (aka 'const code_location') without a user-provided default constructor
static const YYLTYPE yyloc_default
                     ^
                                   = {}
1 error generated.
```
```
/var/folders/7d/3dfz8sj91zjdmmzwzz1pw84r0000gp/T/error_recovery.cpp:1437:31: error: expected unqualified-id
                  yy_repairs *new = (yy_repairs *) YYMALLOC (sizeof (yy_repairs));
                              ^
/var/folders/7d/3dfz8sj91zjdmmzwzz1pw84r0000gp/T/error_recovery.cpp:1438:22: error: expected a type
                  new->id = count;
                     ^
/var/folders/7d/3dfz8sj91zjdmmzwzz1pw84r0000gp/T/error_recovery.cpp:1439:22: error: expected a type
                  new->next = 0;
                     ^
/var/folders/7d/3dfz8sj91zjdmmzwzz1pw84r0000gp/T/error_recovery.cpp:1440:22: error: expected a type
                  new->stack_length = stack_length;
                     ^
/var/folders/7d/3dfz8sj91zjdmmzwzz1pw84r0000gp/T/error_recovery.cpp:1441:22: error: expected a type
                  new->states = (yy_state_t *) YYMALLOC (sizeof (yy_state_t) * (stack_length));
                     ^
/var/folders/7d/3dfz8sj91zjdmmzwzz1pw84r0000gp/T/error_recovery.cpp:1442:22: error: expected a type
                  new->state = new->states + (current->state - current->states);
                     ^
/var/folders/7d/3dfz8sj91zjdmmzwzz1pw84r0000gp/T/error_recovery.cpp:1443:30: error: expected a type
                  YYCOPY (new->states, current->states, current->state - current->states + 1);
                             ^
/var/folders/7d/3dfz8sj91zjdmmzwzz1pw84r0000gp/T/error_recovery.cpp:1444:22: error: expected a type
                  new->repair_length = current->repair_length + 1;
                     ^
/var/folders/7d/3dfz8sj91zjdmmzwzz1pw84r0000gp/T/error_recovery.cpp:1445:22: error: expected a type
                  new->prev_repair = current;
                     ^
/var/folders/7d/3dfz8sj91zjdmmzwzz1pw84r0000gp/T/error_recovery.cpp:1446:22: error: expected a type
                  new->repair.type = insert;
                     ^
/var/folders/7d/3dfz8sj91zjdmmzwzz1pw84r0000gp/T/error_recovery.cpp:1447:22: error: expected a type
                  new->repair.term = (yysymbol_kind_t) yyx;
                     ^
/var/folders/7d/3dfz8sj91zjdmmzwzz1pw84r0000gp/T/error_recovery.cpp:1450:48: error: expected a type
                  if (! yy_process_repairs (new, yyx))
                                               ^
/var/folders/7d/3dfz8sj91zjdmmzwzz1pw84r0000gp/T/error_recovery.cpp:1452:34: error: expected a type
                      YYFREE (new);
                                 ^
/var/folders/7d/3dfz8sj91zjdmmzwzz1pw84r0000gp/T/error_recovery.cpp:1457:29: error: expected a type
                  tail = new;
                            ^
/var/folders/7d/3dfz8sj91zjdmmzwzz1pw84r0000gp/T/error_recovery.cpp:1473:40: error: expected a type
                  yy_print_repairs (new);
                                       ^
 ```
```
/var/folders/7d/3dfz8sj91zjdmmzwzz1pw84r0000gp/T/error_recovery.cpp:1196:3: error: expected identifier
  delete,
  ^
 ```
```
/var/folders/7d/3dfz8sj91zjdmmzwzz1pw84r0000gp/T/error_recovery.cpp:1450:25: error: no matching function for call to 'yy_process_repairs'
                  if (! yy_process_repairs (reps, yyx))
                        ^~~~~~~~~~~~~~~~~~
```
…ntype' with an rvalue of type 'int'

```
error: cannot initialize return object of type 'enum yytokentype' with an rvalue of type 'int'
    return 0;
           ^
1 error generated.
```
```
Undefined symbols for architecture arm64:
  "yylex(YYSTYPE*, code_location*)", referenced from:
      yyparse() in named_references-92348a.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
FUndefined symbols for architecture arm64:
  "yylex(YYSTYPE*, code_location*)", referenced from:
      yyparse() in typed_midrule_actions-686229.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
F
```
… this behavior is deprecated

```
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
```
@ydah
ydah requested a review from yui-knk August 9, 2024 13:53
@ydah ydah mentioned this pull request Aug 26, 2024
@yui-knk
yui-knk merged commit 22a5ce6 into ruby:master Aug 29, 2024
@yui-knk

yui-knk commented Aug 29, 2024

Copy link
Copy Markdown
Collaborator

LGTM! Thank you!

@ydah
ydah deleted the cpp-ci branch August 30, 2024 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error in initialization within YY_INITIAL_VALUE() with C++

2 participants