On Thu, May 26, 2016 at 02:14:29PM -0600, Todd C. Miller wrote:
> On Thu, 26 May 2016 22:07:14 +0200, Martin Natano wrote:
> 
> > > diff -u -p -u -r1.11 Makefile
> > > --- share/locale/ctype/Makefile   20 Mar 2016 15:45:40 -0000      1.11
> > > +++ share/locale/ctype/Makefile   23 Mar 2016 20:16:56 -0000
> > > @@ -9,8 +9,7 @@ NOMAN=    # defined
> > >  all: UTF-8.out
> > >  
> > >  UTF-8.out: en_US.UTF-8.src
> > > - ${CPP} < ${.CURDIR}/en_US.UTF-8.src | \
> > > -     sed -e '/^#/d' | mklocale -o ${.TARGET}
> > > + ${CC} -E -P - < ${.CURDIR}/en_US.UTF-8.src | mklocale -o ${.TARGET}
> > 
> > I think cpp can be dropped here. As far as I can tell it is only used to
> > remove the comments, which mklocale can do by itself. The output stays
> > the same with just this:
> > 
> >     mklocale -o ${.TARGET} ${.CURDIR}/en_US.UTF-8.src
> 
> I don't see anything in mklocale that handles C-style comments.
> We can check the output:

mklocale.1 says "C-style comments are used to place comments in the
file."

> 
> $ cc -E -P - < en_US.UTF-8.src | mklocale -o foo
> $ mklocale -o bar en_US.UTF-8.src
> $ cmp foo bar
> foo bar differ: char 3132, line 6

Yes, the difference is due to cpp vs. cc -E. Try to diff against the
output generated with cpp. Then the files are the same.

$ cpp < en_US.UTF-8.src | mklocale -o foo
$ cc -E -P - < en_US.UTF-8.src | mklocale -o foo2
$ mklocale -o foo3 en_US.UTF-8.src
$ cmp foo foo2
foo foo2 differ: char 3132, line 4
$ cmp foo foo3
$


> 
> I think that file does need preprocessing.
> 
>  - todd

Reply via email to