[tz] [PROPOSED 1/7] Avoid undefined behavior if no Link lines

Tom Lane tgl at sss.pgh.pa.us
Wed Oct 26 14:16:27 UTC 2022


Paul Eggert <eggert at cs.ucla.edu> writes:
> The core dump occurred because GCC translates this:

>    qsort(links, nlinks, sizeof *links, qsort_linkcmp);

> as if it were this:

>    if (nlinks == 0)
>      __builtin_trap();
>    qsort(links, nlinks, sizeof *links, qsort_linkcmp);

Right, so they are actually going out of their way to make it
a gotcha.  What point does that serve?

			regards, tom lane



More information about the tz mailing list