tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: odd fonts/t1lib compile mystery on osx



On Fri, Jan 04, 2019 at 10:41:48PM +0000, maya%netbsd.org@localhost wrote:
> abort is a standard C function, using the standard name is playing
> chicken with the optimizer.
> 
> -fno-builtin sounds good
> (-fno-builtin-abort also a thing)

ah, so that t1lib code is a bit shady on its version of abort.
it does this:

lib/type1/objects.h:#define   abort(line,no)       t1_abort(line,no)

so, in theory that macro should rename all abort(line,no) calls
into t1_abort() and thus not conflict with the posix abort() call.


I didn't put it in the other message, but I also tried this:

 - change all 8 calls to abort(line,no) in objects.c to xabort(line,no)

 - tried this macro:

     #define xabort(A,B) do { fprintf(stderr, "ABORT!\n"); exit(1); } while (0)


   and the program still crashed.   if I changed it to:


     #define xabort(A,B) do { fprintf(stderr, "ABORT!\n"); } while (0)


   then it did not crash (or print "ABORT!\n").


I think that test gets abort() out of the way, since the xabort
macro expands to not call any abort function.   but if the xabort
macro ends in a call that is __dead2 ... then it crashes too.


chuck




Home | Main Index | Thread Index | Old Index