This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Free BSD ioctl problem (Renesas EDOSK2674)


Hello Andrew,

in your last mail regarding the IOCTL problem you suggested the following to
me:

> The last paragraph says:
>
>         Some functions such as open take a fixed set of arguments, but
>         occasionally ignore the last few. Strict adherence to ISO C
>         requires these functions to be defined as variadic; in
>         practice, however, the GNU C compiler and most other C
>         compilers let you define such a function to take a fixed set
>         of arguments--the most it can ever use--and then only declare
>         the function as variadic (or not declare its arguments at
>         all!).
>
> That describes what is going on here. ioctl is defined to take three
> parameters, the maximum it uses and the declaration is variadic.
>
> So i would say you have a compiler bug. The fact that this code works
> correctly on i386, mips, ppc, arm etc, also suggests its an H8S
> compiler bug.
>
> I suggest you make a simple example program that demostrats the bug
> and post a bug report to the gcc mailing list and maybe the gnuh8
> list.

I did what you have suggested to and received the following answer from GNU
support:

//--------------------------------------------------------------------------
-
"I think the statments made in the above link regarding variadic functions
are plainly wrong. It may work for sometimes for some targets but definately
not for all targets. The reason is the compiler may and can pass arguments
differently depending on the prototype and especially for varadic
functions."

Both the declaration and definition should agree mixing them isn't going to
work."

Please refer following link,
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16000

Regards,
GNU Support.
//-----------------------------------------------------------------------

So maybe it is necessary now to fix the function ioctl in io.cxx to take a
variable number of arguments.

Regards, Uwe





-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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