diff mbox series

[wwwdocs] gcc-14: Some very common historic Autoconf probes that no longer work

Message ID 87r0hb4dsr.fsf@oldenburg.str.redhat.com
State New
Headers show
Series [wwwdocs] gcc-14: Some very common historic Autoconf probes that no longer work | expand

Commit Message

Florian Weimer Feb. 17, 2024, 9:53 a.m. UTC
---
 htdocs/gcc-14/porting_to.html | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)


base-commit: 1fcd61437d6a3d7bf24b993b09d525486dc9a2e5

Comments

Sam James Feb. 17, 2024, 9:33 p.m. UTC | #1
Florian Weimer <fweimer@redhat.com> writes:

> ---
>  htdocs/gcc-14/porting_to.html | 43 +++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 43 insertions(+)
>
> diff --git a/htdocs/gcc-14/porting_to.html b/htdocs/gcc-14/porting_to.html
> index 123b5e9f..ab65c5e7 100644
> --- a/htdocs/gcc-14/porting_to.html
> +++ b/htdocs/gcc-14/porting_to.html
> @@ -437,6 +437,49 @@ issues addressed in more recent versions.)  Versions before 2.69 may
>  have generic probes (for example for standard C support) that rely on
>  C features that were removed in C99 and thus fail with GCC 14.
>  
> +<p>
> +Older Autoconf versions (for example, Autoconf 2.13) generate core
> +probes that are incompatible with C99.  These include the basic
> +compiler functionality check:
> +
> +<pre>
> +#include "confdefs.h"
> +main(){return(0);}
> +</pre>
> +
> +And a check for standard C compatibility:
> +
> +<pre>
> +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
> +int main () { int i; for (i = 0; i &lt; 256; i++)
> +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
> +exit (0); }
> +</pre>
> +

Consider adding the check name so it shows up on search engine results?

("Checking for $X ... no")

> +(Several variants with different line breaks and whitespace were in
> +use.)  If it is not possible to port the configure script to current
> +Autoconf, these issues can be patched directly:
> +
> +<pre>
> +#include "confdefs.h"
> +<ins>int</ins> main(){return(0);}
> +</pre>
> +
> +And for the second probe:
> +
> +<pre>
> +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
> +int main () { int i; for (i = 0; i &lt; 256; i++)
> +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) <ins>return 2</ins>;
> +<ins>return 0</ins>; }
> +</pre>
> +
> +There is a long tail of less frequent issues, involving keyword
> +checking (for <code>inline</code>), and checks for <code>dlopen</code>
> +and <code>mmap</code>.  A <code>setvbuf</code> probe was previously
> +expected to fail at run time because it triggered undefined behavior,
> +now it fails because of a compilation error.
> +
>  <h4 id="errors-as-warnings">Turning errors back into warnings</h4>
>  
>  <p>

LGTM otherwise.

>
> base-commit: 1fcd61437d6a3d7bf24b993b09d525486dc9a2e5
Gerald Pfeifer March 10, 2024, 11:20 p.m. UTC | #2
On Sat, 17 Feb 2024, Florian Weimer wrote:
> +<p>
> +Older Autoconf versions (for example, Autoconf 2.13) generate core
> +probes that are incompatible with C99.  These include the basic
> +compiler functionality check:
:
:

Yes, thank you!

Gerald

PS: Feel free to copy me on wwwdocs patches.
diff mbox series

Patch

diff --git a/htdocs/gcc-14/porting_to.html b/htdocs/gcc-14/porting_to.html
index 123b5e9f..ab65c5e7 100644
--- a/htdocs/gcc-14/porting_to.html
+++ b/htdocs/gcc-14/porting_to.html
@@ -437,6 +437,49 @@  issues addressed in more recent versions.)  Versions before 2.69 may
 have generic probes (for example for standard C support) that rely on
 C features that were removed in C99 and thus fail with GCC 14.
 
+<p>
+Older Autoconf versions (for example, Autoconf 2.13) generate core
+probes that are incompatible with C99.  These include the basic
+compiler functionality check:
+
+<pre>
+#include "confdefs.h"
+main(){return(0);}
+</pre>
+
+And a check for standard C compatibility:
+
+<pre>
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i &lt; 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+</pre>
+
+(Several variants with different line breaks and whitespace were in
+use.)  If it is not possible to port the configure script to current
+Autoconf, these issues can be patched directly:
+
+<pre>
+#include "confdefs.h"
+<ins>int</ins> main(){return(0);}
+</pre>
+
+And for the second probe:
+
+<pre>
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i &lt; 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) <ins>return 2</ins>;
+<ins>return 0</ins>; }
+</pre>
+
+There is a long tail of less frequent issues, involving keyword
+checking (for <code>inline</code>), and checks for <code>dlopen</code>
+and <code>mmap</code>.  A <code>setvbuf</code> probe was previously
+expected to fail at run time because it triggered undefined behavior,
+now it fails because of a compilation error.
+
 <h4 id="errors-as-warnings">Turning errors back into warnings</h4>
 
 <p>