Re: using long long and printf("%m") in debian

2006-08-21 Thread Wouter Verhelst
On Sun, Aug 20, 2006 at 07:48:29PM +0300, Lars Wirzenius wrote: > su, 2006-08-20 kello 18:08 +0200, Wouter Verhelst kirjoitti: > > On Sun, Aug 20, 2006 at 03:59:17PM +0300, Lars Wirzenius wrote: > > [...] > > > fprintf(stderr, "Could not read file: %s: %s\n", filename, > > > strerro

Re: using long long and printf("%m") in debian

2006-08-20 Thread Lars Wirzenius
su, 2006-08-20 kello 18:08 +0200, Wouter Verhelst kirjoitti: > On Sun, Aug 20, 2006 at 03:59:17PM +0300, Lars Wirzenius wrote: > [...] > > fprintf(stderr, "Could not read file: %s: %s\n", filename, > > strerror(errno)); > > > > Please consider the above a minimal requirement for an

Re: using long long and printf("%m") in debian

2006-08-20 Thread Russ Allbery
Wouter Verhelst <[EMAIL PROTECTED]> writes: > Bullshit. The above could also have been done as > sprintf(buf, "Could not read file %s", filename) > perror(buf); There's a buffer overflow waiting to happen. > or, perhaps (depending on what the file actually was): > perror("Could not read config

Re: using long long and printf("%m") in debian

2006-08-20 Thread Wouter Verhelst
On Sun, Aug 20, 2006 at 03:59:17PM +0300, Lars Wirzenius wrote: [...] > fprintf(stderr, "Could not read file: %s: %s\n", filename, > strerror(errno)); > > Please consider the above a minimal requirement for an error message: it > reports the operation that was attempted (reading a

Re: using long long and printf("%m") in debian

2006-08-20 Thread Lars Wirzenius
su, 2006-08-20 kello 12:48 +0200, Hendrik Sattler kirjoitti: > And there is always perror() which is something like: > printf("%s%s%s\n",(s?s:""),(s?": ":""),strerror(errno)); > So, using something like: > perror(__FUNCTION__); > of > perror(NULL); > is probably a good idea. Not if you care

Re: using long long and printf("%m") in debian

2006-08-20 Thread Hendrik Sattler
Am Samstag 19 August 2006 17:28 schrieb Steve Greenland: > On 18-Aug-06, 16:48 (CDT), Hendrik Sattler <[EMAIL PROTECTED]> wrote: > > No, %m is, according to printf(2) manpage: > > m (Glibc extension.) Print output of strerror(errno). No argument > > is required. > > > > So why isn't > > pri

Re: using long long and printf("%m") in debian

2006-08-19 Thread Steve Greenland
On 18-Aug-06, 16:48 (CDT), Hendrik Sattler <[EMAIL PROTECTED]> wrote: > > No, %m is, according to printf(2) manpage: > m (Glibc extension.) Print output of strerror(errno). No argument is > required. > > So why isn't > printf("%s\n",strerror(errno)); > used instead of > printf("%m\n");

Re: using long long and printf("%m") in debian

2006-08-18 Thread Michael Rasmussen
On 2006-08-19 02:47:55, Gabor Gombas wrote: in current gcc versions, so the real-life answer is more like "you can assume C99 support on all archs". Nice, thanks. -- Hilsen/Regards Michael Rasmussen Get my public GnuPG keys: michael rasmussen cc http://keyserver.veridis.com:11371/pks/looku

Re: using long long and printf("%m") in debian

2006-08-18 Thread Gabor Gombas
On Sat, Aug 19, 2006 at 12:52:17AM +0200, Michael Rasmussen wrote: > Is there any written documentation on debian.org for support of c99 in > the archs supported by debian? Well, even the gcc-4.2 documentation still has the sentence "GCC has incomplete support for this [C99] standard version",

Re: using long long and printf("%m") in debian

2006-08-18 Thread Michael Rasmussen
On 2006-08-19 00:25:38, Lars Wirzenius wrote: Unless -std=c99 doesn't work on one of the Debian archs, certainly. Great. Now added, and a nice warning free compilation as a result:-) Is there any written documentation on debian.org for support of c99 in the archs supported by debian? --

Re: using long long and printf("%m") in debian

2006-08-18 Thread Lars Wirzenius
pe, 2006-08-18 kello 23:44 +0200, Michael Rasmussen kirjoitti: > So from what your a saying it would be allowed to add -std=c99 to gcc > options? It would be nice since I will avoid these warnings using > option -pedantic including warning against // before comments:-) Unless -std=c99 doesn't

Re: using long long and printf("%m") in debian

2006-08-18 Thread Michael Rasmussen
On 2006-08-18 23:48:02, Hendrik Sattler wrote: So why isn't printf("%s\n",strerror(errno)); used instead of printf("%m\n"); ? Not like a problem in Debian GNU/* but you should tell upstream about questionable coding style and portability. I agree with you on this issue - I personally prefer

Re: using long long and printf("%m") in debian

2006-08-18 Thread Hendrik Sattler
Am Freitag 18 August 2006 23:25 schrieb Michael Rasmussen: > I have a package which relies on support for long long and using gcc > does not give problems. The same goes for printf support of %m. No, %m is, according to printf(2) manpage: m (Glibc extension.) Print output of strerror(errno).

Re: using long long and printf("%m") in debian

2006-08-18 Thread Michael Rasmussen
On 2006-08-18 23:36:50, Lars Wirzenius wrote: C90 has been obsoleted by C99. The C implementation we have, consisting of gcc and glibc, support long long and %m (the latter being a GNU extension, even, it seems). So from what your a saying it would be allowed to add -std=c99 to gcc options?

Re: using long long and printf("%m") in debian

2006-08-18 Thread Lars Wirzenius
pe, 2006-08-18 kello 23:25 +0200, Michael Rasmussen kirjoitti: > I have a package which relies on support for long long and using gcc > does not give problems. The same goes for printf support of %m. What > various me is that these features are not supported in ISO C90. My > question is if th

using long long and printf("%m") in debian

2006-08-18 Thread Michael Rasmussen
Hi list, I have a package which relies on support for long long and using gcc does not give problems. The same goes for printf support of %m. What various me is that these features are not supported in ISO C90. My question is if this is problem in Debian and if so should I make some check