Mail Archives: djgpp-workers/2001/11/26/16:06:45
Hello.
Eli Zaretskii wrote:
>
> Richard Dawe wrote:
> >
> > Unix98 specifies that st_blksize should be a blksize_t not an off_t.
> > Does anyone object to this change? Will it break source compatibility?
>
> It shouldn't break source compatibility, but with today's picky
> defaults for GCC warnings you can never know. I think it's best to
> write a short test program and see whether it compiles.
I compiled the following program with -Wall -g against:
* DJGPP 2.03 with -Wall -g,
* DJGPP CVS with my blksize_t patch and -DWE_HAVE_BLKSIZE_T.
No warnings or errors were generated using gcc 3.0.2 (NB: not the latest
patched release of gcc 3.0.2). Please let me know if I've missed out any
tests for source compatibility (I couldn't think of any more).
Thanks, bye, Rich =]
--
Richard Dawe
http://www.phekda.freeserve.co.uk/richdawe/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
int
main (void)
{
struct stat s;
off_t foo = 123;
off_t *po = NULL;
#ifdef WE_HAVE_BLKSIZE_T
blksize_t bar = 456;
blksize_t *pb = NULL;
#endif
int i = 789;
int *pi = NULL;
memset(&s, 0, sizeof(s));
s.st_blksize = foo;
s.st_blksize = i;
#ifdef WE_HAVE_BLKSIZE_T
printf("foo was %d\n", foo);
foo = bar;
printf("foo is now %d\n", foo);
printf("i was %d\n", i);
i = bar;
printf("i is now %d\n", i);
pb = &i;
pb = &foo;
pi = &bar;
po = &bar;
#endif
pi = &foo;
po = &i;
return(EXIT_SUCCESS);
}
- Raw text -