paul-j-lucas / cdecl

Composing and deciphering C (or C++) declarations or casts, aka ‘‘gibberish.’’
GNU General Public License v3.0
90 stars 11 forks source link

Bison/Flex: Posix Yacc warnings #4

Closed lrosenman closed 5 years ago

lrosenman commented 5 years ago

I don't know if you want to fix these, but I get this warning set on 6.4 on FreeBSD:

/bin/sh ../ylwrap lexer.l lex.yy.c lexer.c -- flex --- parser.c --- /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:29.1-7: warning: POSIX Yacc does not support %expect [-Wyacc] %expect 27 ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:719.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_QMARK_COLON "?:" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:726.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_EXCLAM_EQ "!=" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:727.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_PERCENT_EQ "%=" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:728.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_AMPER2 "&&" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:729.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_AMPER_EQ "&=" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:730.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_STAR_EQ "=" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:731.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_PLUS2 "++" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:732.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_PLUS_EQ "+=" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:733.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_MINUS2 "--" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:734.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_MINUS_EQ "-=" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:735.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_ARROW "->" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:736.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_SLASH_EQ "/=" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:737.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_LESS2 "<<" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:738.35-39: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_LESS2_EQ "<<=" ^~~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:739.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_LESS_EQ "<=" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:740.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_EQ2 "==" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:741.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_GREATER_EQ ">=" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:742.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_GREATER2 ">>" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:743.35-39: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_GREATER2_EQ ">>=" ^~~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:744.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_CIRC_EQ "^=" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:745.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_PIPE_EQ "|=" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:746.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_PIPE2 "||" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:777.35-39: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_ELLIPSIS "..." / for varargs / ^~~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:805.35-39: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_ARROW_STAR "->" ^~~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:810.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_COLON2 "::" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:811.35-39: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_COLON2_STAR "::" ^~~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:820.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_DOT_STAR "." ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:851.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_LBRACKET2 "[[" / for attribute specifiers / ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:852.35-38: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_RBRACKET2 "]]" / for attribute specifiers / ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:884.39-43: warning: POSIX Yacc does not support string literals [-Wyacc] %token Y_LESS_EQ_GREATER "<=>" ^~~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1048.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; FREE( $$ ); } any_name ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1049.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; FREE( $$ ); } any_name_expected ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1050.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; FREE( $$ ); } name_expected ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1051.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; FREE( $$ ); } name_opt ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1052.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; FREE( $$ ); } set_option_name ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1053.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; FREE( $$ ); } Y_LANG_NAME ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1054.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; FREE( $$ ); } Y_NAME ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1057.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; c_sname_free( &$$ ); } of_scope_english ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1058.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; c_sname_free( &$$ ); } of_scope_list_english ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1059.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; c_sname_free( &$$ ); } of_scope_list_english_opt ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1060.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; c_sname_free( &$$ ); } scope_sname_c_opt ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1061.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; c_sname_free( &$$ ); } sname_c ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1062.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; c_sname_free( &$$ ); } sname_c_expected ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1063.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; c_sname_free( &$$ ); } sname_c_opt ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1064.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; c_sname_free( &$$ ); } sname_english ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1065.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; c_sname_free( &$$ ); } sname_english_expected ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1066.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; c_sname_free( &$$ ); } typedef_sname_c ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1067.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; c_sname_free( &$$ ); } any_sname_c ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1068.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; c_sname_free( &$$ ); } any_sname_c_expected ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1069.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; c_sname_free( &$$ ); } Y_CONSTRUCTOR_SNAME ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:1070.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] %destructor { DTRACE; c_sname_free( &$$ ); } Y_DESTRUCTOR_SNAME ^~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:2631.5-9: warning: POSIX Yacc does not support string literals [-Wyacc] | "..." ^~~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:2899.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "&&" { $$ = T_RVALUE_REFERENCE; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:2923.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "->" type_c_ast { type_push( $2.ast ); } cast_c_ast_opt ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:3177.22-25: warning: POSIX Yacc does not support string literals [-Wyacc] | / type_c_ast / "&&" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:3355.5-9: warning: POSIX Yacc does not support string literals [-Wyacc] | "..." ^~~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:3665.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] : "[[" attribute_name_list_c_type_opt "]]" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:3665.41-44: warning: POSIX Yacc does not support string literals [-Wyacc] : "[[" attribute_name_list_c_type_opt "]]" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4079.34-37: warning: POSIX Yacc does not support string literals [-Wyacc] | / type_c_ast / any_typedef "::" sname_c ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4103.34-37: warning: POSIX Yacc does not support string literals [-Wyacc] | / type_c_ast / any_typedef "::" typedef_sname_c ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4161.13-16: warning: POSIX Yacc does not support string literals [-Wyacc] | sname_c "::" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4173.17-20: warning: POSIX Yacc does not support string literals [-Wyacc] | any_typedef "::" ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4188.13-16: warning: POSIX Yacc does not support string literals [-Wyacc] : sname_c "::" Y_NAME ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4202.13-16: warning: POSIX Yacc does not support string literals [-Wyacc] | sname_c "::" any_typedef ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4279.21-24: warning: POSIX Yacc does not support string literals [-Wyacc] : typedef_sname_c "::" sname_c ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4291.21-24: warning: POSIX Yacc does not support string literals [-Wyacc] | typedef_sname_c "::" any_typedef ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4370.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "!=" { $$ = OP_EXCLAM_EQ ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4372.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "%=" { $$ = OP_PERCENT_EQ ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4374.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "&&" { $$ = OP_AMPER2 ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4375.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "&=" { $$ = OP_AMPER_EQ ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4378.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "=" { $$ = OP_STAR_EQ ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4380.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "++" { $$ = OP_PLUS2 ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4381.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "+=" { $$ = OP_PLUS_EQ ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4384.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "--" { $$ = OP_MINUS2 ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4385.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "-=" { $$ = OP_MINUS_EQ ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4386.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "->" { $$ = OP_ARROW ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4387.5-9: warning: POSIX Yacc does not support string literals [-Wyacc] | "->" { $$ = OP_ARROW_STAR ; } ^~~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4389.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | ".*" { $$ = OP_DOT_STAR ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4391.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "/=" { $$ = OP_SLASH_EQ ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4392.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "::" { $$ = OP_COLON2 ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4394.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "<<" { $$ = OP_LESS2 ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4395.5-9: warning: POSIX Yacc does not support string literals [-Wyacc] | "<<=" { $$ = OP_LESS2_EQ ; } ^~~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4396.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "<=" { $$ = OP_LESS_EQ ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4397.5-9: warning: POSIX Yacc does not support string literals [-Wyacc] | "<=>" { $$ = OP_LESS_EQ_GREATER ; } ^~~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4399.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "==" { $$ = OP_EQ2 ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4401.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | ">>" { $$ = OP_GREATER2 ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4402.5-9: warning: POSIX Yacc does not support string literals [-Wyacc] | ">>=" { $$ = OP_GREATER2_EQ ; } ^~~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4403.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | ">=" { $$ = OP_GREATER_EQ ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4404.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "?:" { $$ = OP_QMARK_COLON ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4407.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "^=" { $$ = OP_CIRC_EQ ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4409.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "||" { $$ = OP_PIPE2 ; } ^~~~ /wrkdirs/usr/ports/devel/cdecl/work/cdecl-cdecl-6.4/src/parser.y:4410.5-8: warning: POSIX Yacc does not support string literals [-Wyacc] | "|=" { $$ = OP_PIPE_EQ ; } ^~~~

paul-j-lucas commented 5 years ago

I looked this up once (but I can't find the link at the moment). It's not my bug. Something in the Autotools (autoconf? automake?) system is wrongly specifying -Wyacc --- I don't do it. I think this was fixed in their stuff, so you might try updating that stuff.

You could also try changing the line in src/Makefile.am to:

AM_YFLAGS = -d -Wno-yacc

and hope that the -Wno-yacc comes after the -Wyacc so it'll turn it off. I can't test this myself since I don't get the warning on any machines I have access to. If it works, I can hack in the work-around.

lrosenman commented 5 years ago

I'm using the latest in FreeBSD ports (head). I'll play and get back to you.

lrosenman commented 5 years ago

that DOES fix it.

--- parser.c --- /bin/sh ../ylwrap parser.y y.tab.c parser.c y.tab.h echo parser.c | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/ y.output parser.output -- bison -y -d -Wno-yacc --- lexer.c ---

paul-j-lucas commented 5 years ago

OK, I'll hack it in. (FYI: I don't specify the -y either --- their stuff does that.)

lrosenman commented 5 years ago

The -y isn't from me :)

Also,

--- autocomplete.o --- autocomplete.c:381:39: warning: 'CPPFunction' is deprecated [-Wdeprecated-declarations] rl_attempted_completion_function = (CPPFunction*)attempt_completion; ^ /usr/local/include/readline/rltypedefs.h:38:47: note: 'CPPFunction' has been explicitly marked deprecated here typedef char **CPPFunction () attribute ((deprecated)); ^

paul-j-lucas commented 5 years ago

One issue at a time. :)

lrosenman commented 5 years ago

:)

lrosenman commented 5 years ago

want a separate issue for the readline fun?

paul-j-lucas commented 5 years ago

Sadly, the bison that Apple ships with Xcode is ancient:

/bin/sh ../ylwrap parser.y y.tab.c parser.c y.tab.h `echo parser.c | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/` y.output parser.output -- bison -y -d -Wno-yacc
/bin/sh ../ylwrap lexer.l lex.yy.c lexer.c -- flex
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bison: invalid option -- W

so this isn't a simple work-around. I could write stuff in configure.ac to probe bison to see if it accepts the -W option, but that's more work. :(

lrosenman commented 5 years ago

I can patch it in the FreeBSD port.

paul-j-lucas commented 5 years ago

Yeah, open a separate issue for readline; thanks.

paul-j-lucas commented 5 years ago

Wait: patch what? (And how would that help the bison that Apple ships with Xcode?)

lrosenman commented 5 years ago

I can patch the src/Makefile.am that the FreeBSD ports system uses to add -Wno-yacc to the AM_YFLAGS line to shut the warnings up.

And opened #5 for the readline issue.

lrosenman commented 5 years ago

It wouldn't help Xcode/bison... just make the FreeBSD build clean of warnings.

lrosenman commented 5 years ago

thusly:

[I] ➜ cat files/patch-src_Makefile.am --- src/Makefile.am.orig 2019-06-19 15:19:07 UTC +++ src/Makefile.am @@ -21,7 +21,7 @@ bin_PROGRAMS = cdecl

AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_builddir)/lib -AM_YFLAGS = -d +AM_YFLAGS = -d -Wno-yacc LDADD = $(top_builddir)/lib/libgnu.a

BUILT_SOURCES = parser.c parser.h lexer.c

ler in ports/devel/cdecl at borg [I] ➜

paul-j-lucas commented 5 years ago

Oh. Well, that's your call. I can try to do a work-around on my end, but it'll take a little while.

There's no pre-written autoconf macro for probing bison, so I'll have to write one myself (and I'm not that knowledgable about m4).

lrosenman commented 5 years ago

NBD either way.

Thanks for looking.

paul-j-lucas commented 5 years ago

I have to get back to my day job. :/

lrosenman commented 5 years ago

Whenever, and I do too.

paul-j-lucas commented 5 years ago

Actually, I just found this. I think I can replace AC_PROG_YACC (that adds the -y) with this. If the -y isn't added then bison shouldn't warn about POSIX yacc compatibility --- in which case the -Wno-yacc shouldn't be needed at all. But I'll have to try it later.

paul-j-lucas commented 5 years ago

Slow work day. Try the bison-yacc-warning branch. Be sure to start from scratch. After you pull the branch:

$ git clean -xdf
$ autoreconf -fiv
$ configure
lrosenman commented 5 years ago

seems to DTRT. Thanks!

paul-j-lucas commented 5 years ago

Pushed to master; will be part of the next release.