Wrong documentation for open()

Friedrich Lobenstock fl-newlib@lsl.at
Thu Apr 9 15:38:00 GMT 2015


Hello!

The documentation, eg. the online version at
<https://sourceware.org/newlib/libc.html#index-open>, is wrong in
regards to the implementation of open().

In the documentation the signature of open() is defined as:
    int open(const char *name, int flags, int mode)

BUT in the library in sys/_default_fcntl.h (included via fcntl.h) its
signature is defined as follows:
    int open (const char *, int, ...)

For a minimal implementation which just returns -1 this doesn't matter,
but not when one want's evaluate the other options after parameter "name".

For libgloss/open.c it doesn't actually matter, but it's interface
should also be updated, I guess.

PS: I came across this "bug" after looking at the compilers assembly
code and wondering why on earth it is passing parameters on the stack,
while the called function is expecting parameters in registers.

-- 
MfG / Regards
Friedrich Lobenstock



More information about the Newlib mailing list