Re: ECPG cleanup and fix for clang compile-time problem

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: John Naylor <johncnaylorls@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>, Andres Freund <andres@anarazel.de>, Michael Paquier <michael.paquier@gmail.com>
Date: 2024-11-27T17:59:38Z
Lists: pgsql-hackers
John Naylor <johncnaylorls@gmail.com> writes:
> I think you can go ahead and commit 0001-0003. For 0003 I do admit
> being confused why valgrind had a problem with progname...

Pushed, thanks for looking at it!

As for progname, valgrind was unhappy because the local in main()
went out of scope at return, but the malloc block was still there.
But this was weird coding anyway: pretty much everywhere else,
we store progname in a globally-accessible variable so that it can
be used in error messages.  I figured making it static was a down
payment on someday making ecpg's messages honor that convention.

> FWIW, I also took a quick eyeball check of the coverage output for
> preproc.y looking for untested non-error branches that do things that
> are not covered elsewhere, and I didn't notice any. Some places
> allocating new connections are not covered, which should be handled by
> 0003.

Yeah, ecpg's coverage report is fairly sad overall, but a lot of the
uncovered stuff is autogenerated grammar productions, which I think
we can have high confidence in.  I'm not currently feeling motivated
to try to improve that number.

			regards, tom lane



Commits

  1. ecpg: clean up some other assorted memory leaks.

  2. ecpg: fix some memory leakage of data-type-related structures.

  3. ecpg: put all string-valued tokens returned by pgc.l in local storage.

  4. ecpg: fix more minor mishandling of bad input in preprocessor.

  5. ecpg: fix some minor mishandling of bad input in preprocessor.

  6. ecpg: avoid breaking the IDENT precedence level in two.

  7. ecpg: improve preprocessor's memory management.

  8. ecpg: move some functions into a new file ecpg/preproc/util.c.

  9. ecpg: re-implement preprocessor's string management.

  10. ecpg: major cleanup, simplification, and documentation of parse.pl.

  11. ecpg: remove check_rules.pl.

  12. ecpg: clean up documentation of parse.pl, and add more input checking.

  13. Clean up indentation and whitespace inconsistencies in ecpg.

  14. Exclude flex-generated code from coverage testing