Problem with div (1.9.0, arm7tdmi)
Lewin A.R.W. Edwards
Tue Jul 3 09:41:00 GMT 2001
> > Thanks for this suggestion, I didn't think of it. Returning structures has
> > "just worked" in other contexts for me, I didn't suspect it as the problem.
>It does not need to be a problem, but I think its more likely than
>breaking in the middle of a function, except there is a serious bug in the
>processor or in the newlib implementation of div. I just thought of
>locating the problem.
I mean I wouldn't have thought of looking there (I spent too many hours
looking at this code...)..
Anyway, the results of testing:
div_t y = div(a,b);
this code works.
I guess this is a compiler bug? Like I say, before this has "just worked"
for me (accessing div().member directly) so I haven't given any thought to
its legality. Also I have seen it in numerous code snippets. What is the
legality of this construct?
-- Lewin A.R.W. Edwards
Embedded Engineer, Digi-Frame Inc.
Tel (914) 937-4090 9am-6:30pm M-F ET
Personal: http://www.larwe.com/ http://www.zws.com/
"Far better it is to dare mighty things, to win glorious triumphs, even
though checkered by failure, than to rank with those poor spirits who
neither enjoy much nor suffer much, because they live in the gray twilight
that knows not victory nor defeat."
More information about the Newlib