thradams / cake

Cake a C23 front end and transpiler written in C
http://thradams.com/cake/index.html
GNU General Public License v3.0
543 stars 23 forks source link

Code doesn't compile with `-Werror,-Wincompatible-pointer-types-discards-qualifiers` #153

Closed iphydf closed 7 months ago

iphydf commented 7 months ago
#11 3.571 parser.c:3303:56: error: passing 'const struct struct_or_union_specifier *' to parameter of type 'struct struct_or_union_specifier *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
#11 3.571  3303 |         p_member_declaration = member_declaration(ctx, p_struct_or_union_specifier);
#11 3.571       |                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#11 3.571 ./parser.h:844:110: note: passing argument to parameter here
#11 3.571   844 | struct member_declaration* owner member_declaration(struct parser_ctx* ctx, struct struct_or_union_specifier*);
#11 3.571       |                                                                                                              ^
#11 3.572 parser.c:3311:60: error: passing 'const struct struct_or_union_specifier *' to parameter of type 'struct struct_or_union_specifier *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
#11 3.572  3311 |             p_member_declaration = member_declaration(ctx, p_struct_or_union_specifier);
#11 3.572       |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#11 3.572 ./parser.h:844:110: note: passing argument to parameter here
#11 3.572   844 | struct member_declaration* owner member_declaration(struct parser_ctx* ctx, struct struct_or_union_specifier*);
#11 3.572       |                                                                                                              ^
#11 3.659 2 errors generated.
thradams commented 7 months ago

Is this the current branch?

iphydf commented 7 months ago

Yes, but I've added -Werror, and I'm compiling with clang.

thradams commented 7 months ago

const fixed