[sr #111048] Add a syntax check to code snippets

Zack Weinberg <[email protected]> Tue, 27 Jan 2026 11:33:45 -0500 (EST)
Newsgroups gmane.comp.sysutils.autoconf.bugs
Message-ID <[email protected]>
Update of sr #111048 (group autoconf):

                Priority:       5 - Unprioritized => 2 - Eventually
                Severity:              3 - Normal => 1 - Wish
                  Status:                    None => Postponed

    _______________________________________________________

Follow-up Comment #6:

I'm dubious about the value of this proposed feature _for security auditing_,
given that Autoconf-based configure scripts are infamously difficult to read.
I can see value for debugging in general, though: "this test will never
succeed due to a <language> syntax error in the test program" would be a nice
thing to give people writing configure scripts.

But I don't see a good way to implement it.  The goal, as I understand it, is
to produce a special error for

    #include <linux/landlock.h>
    . /* (intentional?) typo on this line */
    int dummy;

but not for

    #include <linux/landlock.h>
    int dummy;

You might think you could do that with `gcc -fsyntax-only`, but missing
headers are still a hard error for `gcc -fsyntax-only` -- and they kinda have
to be, because macros defined by a system header file can change whether the
rest of the source code is valid.  For example, this source file

    #include <stdatomic.h>
    atomic_uint monitor;

is well-formed *if and only if* stdatomic.h is available.

So I'm marking this as postponed until someone has a clever idea.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?111048>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCaXjo6QAKCRCqLAuaBUf3
TqqBAPwPpbfP+DAgcZJGOdADl28+VzEYKv/L2bUB0vPY1fkdNQD9GVGnjOjN1zL7
BxRf1hFG8xEeFRH1kge4BMQP7MpU6AY=
=Eh5j
-----END PGP SIGNATURE-----