After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 614788 - warning: incompatible implicit declaration of built-in function pow10
warning: incompatible implicit declaration of built-in function pow10
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings
unspecified
Other Linux
: Normal minor
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on: 793444
Blocks: 688447
 
 
Reported: 2010-04-04 01:55 UTC by Adam B
Modified: 2018-02-26 16:12 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Adam B 2010-04-04 01:55:17 UTC
Attempting to use Math.pow10 causes this compiler warning:

  warning: incompatible implicit declaration of built-in function ‘pow10’

To reproduce:
--------------------
using Math;

int main(string[] args)
{
	Math.pow10(1.23);
	return 0;
}
-------------------
This is on Ubuntu 9.10 with Vala 0.7.10.  My guess is that these functions are GNU only?  /usr/include/bits/mathcalls.h declares them:

#ifdef __USE_GNU
/* A function missing in all standards: compute exponent to base ten.  */
__MATHCALL (exp10,, (_Mdouble_ __x));
/* Another name occasionally used.  */
__MATHCALL (pow10,, (_Mdouble_ __x));
#endif
Comment 1 Adam Dingle 2010-04-10 18:20:19 UTC
I'm seeing this too.  Yes, pow10 is a GNU extension.  When valac generates C code, it should insert this line before including math.h:

#define _GNU_SOURCE

That will prevent the warning.
Comment 2 Michael 'Mickey' Lauer 2018-02-26 16:12:41 UTC
commit 908b2663f2c98542c037a41141a52dbb3b018373 (HEAD -> staging, origin/staging)
Author: Dr. Michael Lauer <mickey@vanille-media.de>
Date:   Mon Feb 26 17:11:50 2018 +0100

    posix: add feature test macro _GNU_SOURCE for exp10(3) and exp10f(3)

commit 2c9e89d0a771ed42d46a28cffbf047790714c216
Author: Dr. Michael Lauer <mickey@vanille-media.de>
Date:   Mon Feb 26 17:11:39 2018 +0100

    glib-2.0: add feature test macro _GNU_SOURCE for exp10(3) and exp10f(3)

commit 5ea9b2127a6b47fb6aa3d99fe8ab9806072b6ff7
Author: Dr. Michael Lauer <mickey@vanille-media.de>
Date:   Mon Feb 26 17:02:36 2018 +0100

    posix: add feature test macro _GNU_SOURCE for pow10(3) and pow10f(3)

commit a16e1627fa963982949dfbd7ffa3acc0671c3fc6
Author: Dr. Michael Lauer <mickey@vanille-media.de>
Date:   Mon Feb 26 17:02:00 2018 +0100

    glib-2.0: add feature test macro _GNU_SOURCE for pow10(3) and pow10f(3)