summaryrefslogtreecommitdiff
path: root/doc/release/upcoming_changes/21154.improvement.rst
blob: 5ff2a3ebf97981c4c11ea788cbc25661063faf9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Math C library feature detection now works for wasm
---------------------------------------------------
The previous feature detection generated C stubs like: 

.. code-block:: C

    void exp(void); // incorrect signature!
    exp();
    
Then checked whether compiling and linking these worked. This generates warnings
that complain that ``exp`` actually has signature ``double exp(double)`` but would
otherwise work. However ``wasm-ld`` creates a hard error in this case, so when
compiling to a wasm target everything is detected as missing.

This is now fixed: we feature detect instead with code like:

.. code-block:: C

    double exp(double); // correct signature!
    exp((double)0);

which ``wasm-ld`` will link. As a side effect, the feature detection code now
works without generating linker warnings.