Skip to content

hp2ps is broken with -DDEBUG

It defines in Main.h:

#if !defined(DEBUG)
#define ASSERT(predicate) /*nothing*/

#else
void _ghcAssert PROTO((char *, unsigned int));

#define ASSERT(predicate)			\
	if (predicate)				\
	    /*null*/;				\
	else					\
	    _ghcAssert(__FILE__, __LINE__)
#endif

but in the actual C file the function is called stgAssert:

#if defined(DEBUG)
void
_stgAssert (filename, linenum)
  char		*filename;
  unsigned int  linenum;
{
    fflush(stdout);
    fprintf(stderr, "ASSERTION FAILED: file %s, line %u\n", filename, linenum);
    fflush(stderr);
    abort();
}
#endif

I ran into this when using hadrian.settings to force ghc to always use -DDEBUG.

Edited by Andreas Klebinger
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information