Bug#175025: dev_t problems with non-gcc compilers
On Thu, 2003-01-02 at 15:49, Ben Collins wrote:
> > sys/sysmacros.h seems to use different method to determine if dev_t is
> > unsigned long long or an array type than the actual dev_t declaration.
> > Here's a test program that fails with tcc (included with Debian):
> >
> > #include <stdio.h>
> > #include <sys/types.h>
> > #include <sys/sysmacros.h>
> >
> > int main(int argc, char *argv[])
> > {
> > dev_t x = 0;
> >
> > printf("%d %d\n", major(x), minor(x));
> > return 0;
> > }
> >
> > Results as:
>
> Shouldn't "dev_t x = 0" be:
>
> dev_t x = makedev(0,0);
>
> ? I think that's your problem, not a header bug. Of course, it all
> depends on what line is line 9.
Well, the = 0 wasn't important, major() and minor() were. Using
makedev() also fails:
test2.c:7: '}' expected
Problem is that glibc defines dev_t as "unsigned long long" for tcc, but
major(), minor() and makedev() macros think dev_t is of some array type.
Reply to: