This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: LFS meets PowerPC - score 0,1


On Fri, Jun 18, 1999 at 02:25:44PM +1000, Geoff Keating wrote:
> Just some suggestions about coding style:
> 
> - I don't think the underscores on the variable names are necessary.
> - Use the real off64_t, not the one with the underscores.

I'm a little shaky on this - note that I included <sys/mman.h> (should
I not?).  The copy it finds has, among other things, these lines:

extern __ptr_t __mmap __P ((__ptr_t __addr, size_t __len, int __prot,
                            int __flags, int __fd, __off_t __offset));
extern __ptr_t __mmap64 __P ((__ptr_t __addr, size_t __len, int __prot,
                              int __flags, int __fd, __off64_t __offset));

Can I then declare the function to take arguments of different names
then those in the prototypes, and is it a good idea?

Also, I seem to recall using off64_t triggering prototype mismatches.

> - Put it in linux/mmap64.c rather than linux/powerpc/mmap64.c, since
>   it's not powerpc-specific.  If the Intel people find that the
>   current version works for them, they can put it in linux/i386/,
>   but I'm sure it won't work on sparc or m68k.

I preferred not to hit more architectures than necessary, since
mmap64() _appeared_ to by working on sparc.  However, now that I think
about it, I suppose that it was probably just picking up a less garbage
value from the input registers.

> - glibc will never work on pre-ANSI compilers, so there's no reason
>   not to write ANSI prototypes in new code.

Just matching the other coding styles I saw when I took a look around.


Dan

/--------------------------------\  /--------------------------------\
|       Daniel Jacobowitz        |__|        SCS Class of 2002       |
|   Debian GNU/Linux Developer    __    Carnegie Mellon University   |
|         dan@debian.org         |  |       dmj+@andrew.cmu.edu      |
\--------------------------------/  \--------------------------------/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]