llround(), round() broken?

2012-06-03 Thread Alan Corey
They probably aren't broken, looks like I need to link in some library. I get "undefined reference to" when I try to compile/link. Shouldn't this be mentioned in the man page? Alan /* test of llround() & round(), fails under 4.7 and 5.0 */ #include #include #include #include int m

Re: llround(), round() broken?

2012-06-03 Thread Ville Valkonen
On 4 June 2012 05:55, Alan Corey wrote: > They probably aren't broken, looks like I need to link in some library. B I > get "undefined reference to" when I try to compile/link. B Shouldn't this be > mentioned in the man page? > > B Alan > > /* > B test of llround() & round(), fails under 4.7 and

Re: llround(), round() broken?

2012-06-03 Thread Anthony J. Bentley
Alan Corey writes: >They probably aren't broken, looks like I need to link in some library. I >get "undefined reference to" when I try to compile/link. Shouldn't this >be mentioned in the man page? FreeBSD has a "Library" section in its man page: LIBRARY Math Library (libm, -lm) I recal

Re: llround(), round() broken?

2012-06-04 Thread Jason McIntyre
On Mon, Jun 04, 2012 at 12:37:07AM -0600, Anthony J. Bentley wrote: > Alan Corey writes: > >They probably aren't broken, looks like I need to link in some library. I > >get "undefined reference to" when I try to compile/link. Shouldn't this > >be mentioned in the man page? > > FreeBSD has a "L

Re: llround(), round() broken?

2012-06-04 Thread Alan Corey
man intro (3) comes close in OpenBSD (I did man -k libraries to find it) It just seems like if a function requires a special library that should be mentioned in the function's man page as well as the header file since it needs both to work. I guess it depends on how surprised you are that the fun

Re: llround(), round() broken?

2012-06-04 Thread Theo de Raadt
This seems to come up most often regarding the math functions. Which Unix system doesn't require -lm for those math functions? > man intro (3) comes close in OpenBSD (I did man -k libraries to find it) > > It just seems like if a function requires a special library that > should be mentioned in

Re: llround(), round() broken?

2012-06-04 Thread Ted Unangst
On Mon, Jun 04, 2012 at 20:40, Theo de Raadt wrote: > This seems to come up most often regarding the math functions. > > Which Unix system doesn't require -lm for those math functions? I think these people have no experience writing any C and OpenBSD is the first place they've tried it. Trying t

Re: llround(), round() broken?

2012-06-05 Thread russell
On 06/04/2012 07:31 PM, Alan Corey wrote: man intro (3) comes close in OpenBSD (I did man -k libraries to find it) It just seems like if a function requires a special library that should be mentioned in the function's man page as well as the header file since it needs both to work. I guess it d

Re: llround(), round() broken?

2012-06-05 Thread Anthony J. Bentley
russell writes: >$man math >DESCRIPTION > These functions constitute the C math library, libm. The link editor > searches this library under the ``-lm'' option. Declarations for these > functions may be obtained from the include file . That manpage was removed from base 11 months ago.