]> granicus.if.org Git - graphviz/commit
fix: take a const parameter in 'aagerror'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 12 Sep 2021 20:00:00 +0000 (13:00 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 12 Sep 2021 22:04:11 +0000 (15:04 -0700)
commit81129836030cbc2faec7a81da8478b45b5b74800
treeb143b93921fba4582452d00e139700dc28fbe2e9
parent83b67702da61cd771ad5a6aedba2b3c675462373
fix: take a const parameter in 'aagerror'

This function does not modify the pointed to data of its argument. However, the
immediate problem this change is addressing is that Bison 3.8 now emits a
prototype for this function:¹

  To comply with the latest POSIX standard, in Yacc compatibility mode
  (options `-y`/`--yacc`) Bison now generates prototypes for yyerror and
  yylex.  In some situations, this is breaking compatibility: if the user
  has already declared these functions but with some differences (e.g., to
  declare them as static, or to use specific attributes), the generated
  parser will fail to compile.  To disable these prototypes, #define yyerror
  (to `yyerror`), and likewise for yylex.

Because the generated prototype takes a const parameter,² these two prototypes
now conflict causing a compilation error. Rather than the work around suggested
by the Bison notes, this change simply re-aligns `aagerror` with the Bison
default.

Related to #2127.

¹ https://github.com/akimd/bison/blob/master/NEWS
² https://www.gnu.org/software/bison/manual/html_node/Error-Reporting-Function.html
lib/cgraph/grammar.y
lib/cgraph/scan.l