Re: [PATCH] cal: fix langinfo build break

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2010-11-15 at 14:28 +0100, Karel Zak wrote:
> On Mon, Nov 15, 2010 at 09:03:09AM -0300, Davidlohr Bueso wrote:
> > From: Davidlohr Bueso <dave@xxxxxxx>
> > cal: fix langinfo build break
> > 
> > When HAVE_LANGINFO_H is not defined we break the compilation in cal.c
> > 
> >   CC     cal.o
> > cal.c: In function âheaders_initâ:
> > cal.c:432: error: â_time_infoâ undeclared (first use in this function)
> > cal.c:432: error: (Each undeclared identifier is reported only once
> > cal.c:432: error: for each function it appears in.)
> > make: *** [cal.o] Error 1
> > 
> > The '_time_info' structure is no where to be found other than in headers_init():
> 
> The _time_info was defined by libc in <localeinfo.h> many many years ago.
> It's obsolete legacy now. Good catch.
> 
Good to know, I had no idea where that came from :)

> > -# define weekday(wd)	_time_info->abbrev_wkday[wd]
> > +  char *weekday[] = { "Sun", "Mon", "Tue", "Wed", "Thu",
> > +		      "Fri", "Sat" };
> > +  
> > +  char *month[] = { "January", "Febuary", "March", "April", "May",
> > +		    "June", "July", "August", "September", "October",
> > +		     "November", "December" };
> > +# define weekday(wd)	weekday[wd]
> > +
> >  #endif
> 
> Hmm... 
> 
> It would be better to add nl_langinfo() with hardcoded default values
> to lib/ and use this private implementation if the standard nl_langinfo() 
> is not available. I'll prepare a patch.
> 

Using hardcoded values globally throughout util-linux-ng might not be
the best approach. If you look at cal vs agetty, for example, cal wants
the full month names, where as agetty abbreviates them.

Thanks,
Davidlohr

--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux