public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH wwwdocs] gcc-14: Some very common historic Autoconf probes that no longer work
@ 2024-02-17  9:53 Florian Weimer
  2024-02-17 21:33 ` Sam James
  2024-03-10 23:20 ` Gerald Pfeifer
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Weimer @ 2024-02-17  9:53 UTC (permalink / raw)
  To: gcc-patches

---
 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>
+
+(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>

base-commit: 1fcd61437d6a3d7bf24b993b09d525486dc9a2e5


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH wwwdocs] gcc-14: Some very common historic Autoconf probes that no longer work
  2024-02-17  9:53 [PATCH wwwdocs] gcc-14: Some very common historic Autoconf probes that no longer work Florian Weimer
@ 2024-02-17 21:33 ` Sam James
  2024-03-10 23:20 ` Gerald Pfeifer
  1 sibling, 0 replies; 3+ messages in thread
From: Sam James @ 2024-02-17 21:33 UTC (permalink / raw)
  To: Florian Weimer; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 2348 bytes --]


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


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 377 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH wwwdocs] gcc-14: Some very common historic Autoconf probes that no longer work
  2024-02-17  9:53 [PATCH wwwdocs] gcc-14: Some very common historic Autoconf probes that no longer work Florian Weimer
  2024-02-17 21:33 ` Sam James
@ 2024-03-10 23:20 ` Gerald Pfeifer
  1 sibling, 0 replies; 3+ messages in thread
From: Gerald Pfeifer @ 2024-03-10 23:20 UTC (permalink / raw)
  To: Florian Weimer; +Cc: gcc-patches

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-10 23:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-17  9:53 [PATCH wwwdocs] gcc-14: Some very common historic Autoconf probes that no longer work Florian Weimer
2024-02-17 21:33 ` Sam James
2024-03-10 23:20 ` Gerald Pfeifer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).