Re: [MacPorts] #62906: ming @0.4.8 cannot be built on PPC Leopard because static declaration of ‘swf4debug’ follows non-static declaration

MacPorts noreply at macports.org
Fri May 21 23:10:24 UTC 2021


#62906: ming @0.4.8 cannot be built on PPC Leopard because static declaration of
‘swf4debug’ follows non-static declaration
------------------------+------------------------
  Reporter:  ballapete  |      Owner:  ryandesign
      Type:  defect     |     Status:  assigned
  Priority:  Normal     |  Milestone:
 Component:  ports      |    Version:  2.6.4
Resolution:             |   Keywords:  leopard
      Port:  ming       |
------------------------+------------------------

Comment (by ryandesign):

 Replying to [comment:12 Min4sT1r1th]:
 > It's required to remove the lines with
 >
 >
 > {{{
 > #if YYDEBUG
 > extern int swf4debug;
 > #endif
 > }}}
 >
 >
 > from
 >
 > {{{
 >
 > .../work/libming-ming-0_4_8/src/actioncompiler/swf4compiler.tab.h
 > .../work/libming-ming-0_4_8/src/actioncompiler/swf5compiler.tab.h
 > }}}
 >
 >
 > Unfortunately these two files are generated by the Makefile in that
 subdirectory, therefore I found no other solution, but to add a new
 command to the rules which generate them, to remove these lines via gsed ;
 this can fail of course, if "#if YYDEBUG" is not starting on line 46 on
 your machine (for whatever reason); that's why I called it some ugly "fix"
 - I guess some sed guru can make a better variant.

 If it's true that that needs to be removed, then the correct solution
 would be to figure out why it's being added in the first place and to stop
 that from happening. Using sed to remove specific line numbers from a
 generated file is too brittle to be considered an acceptable fix; a change
 in ming's source files or in the program that generates that file could
 cause the line numbers to change, which would then cause your sed
 invocation to remove the wrong lines.

 > (and don't try to use the built-in sed, it won't work, at least on my
 machines I had to use the macpports gnu sed, which is apparently much
 newer)

 "Built-in" (macOS) sed is BSD sed. MacPorts sed is GNU sed. BSD sed and
 GNU sed differ in some of their syntax. You can do what you want to do
 with BSD sed, you just have to use the right syntax. Specifically, GNU sed
 and BSD sed differ about whether an argument is required for the `-i`
 flag.

-- 
Ticket URL: <https://trac.macports.org/ticket/62906#comment:17>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list