Discussion:
[PATCH] include/inttypes.h __attribute_const__ typo
Jay Sullivan
2010-12-21 16:53:24 UTC
Permalink
Hi,

I had some code that fails when I include dietlibc's inttypes.h, and
I'm using dietlibc-0.33, the latest CVS checkout.  I'm using Ubuntu
Server 10.10 on an i386 machine, with Ubuntu's gcc-4.3.3-5ubuntu4
package, if that's relevant.

Here's the build I'm doing and the error I get in return:

diet gcc -c main.c -Wall -pedantic-errors -Wno-long-long
In file included from /home/jay/dietlibc/include/sys/types.h:4,
                 from /home/jay/dietlibc/include/stdio.h:5,
                 from main.c:10:
/home/jay/dietlibc/include/inttypes.h:275: error: empty declaration
make: *** [main.o] Error 1

It appears there's an extra semicolon in there.  Here's the patch to fix it:

diff --git a/include/inttypes.h b/include/inttypes.h
index 6a0cd7b..f6dcb6f 100644
--- a/include/inttypes.h
+++ b/include/inttypes.h
@@ -272,7 +272,7 @@ uintmax_t strtoumax (const char *nptr,
char **endptr, int base);

 intmax_t imaxabs(intmax_t j) __attribute_const__;
 typedef struct { intmax_t quot,rem; } imaxdiv_t;
-imaxdiv_t imaxdiv(intmax_t numerator, intmax_t denominator);
__attribute_const__;
+imaxdiv_t imaxdiv(intmax_t numerator, intmax_t denominator)
__attribute_const__;

 __END_DECLS

--
Jay Sullivan

Loading...