if (name)
{
unlink (name);
- free (name);
+ Safe_free (name);
}
return 0;
}
(sym->_isparm && !IS_REGPARM (sym->etype))) &&
addPublics &&
!IS_STATIC (sym->etype) &&
- (IS_FUNC(sym->type) ? (sym->used || sym->fbody) : 1))
+ (IS_FUNC(sym->type) ? (sym->used || IFFUNC_HASBODY(sym->type)) : 1))
{
addSetHead (&publics, sym);
}
}
/* if the main is only a prototype ie. no body then do nothing */
- if (!mainf->fbody)
+ if (!IFFUNC_HASBODY(mainf->type))
{
/* if ! compile only then main function should be present */
if (!options.cc_only && !noAssemble)
copyFile (asmFile, ovrFile);
/* create the stack segment MOF */
- if (mainf && mainf->fbody)
+ if (mainf && IFFUNC_HASBODY(mainf->type))
{
fprintf (asmFile, "%s", iComments2);
fprintf (asmFile, "; Stack segment in internal ram \n");
copyFile (asmFile, bit->oFile);
/* if external stack then reserve space of it */
- if (mainf && mainf->fbody && options.useXstack)
+ if (mainf && IFFUNC_HASBODY(mainf->type) && options.useXstack)
{
fprintf (asmFile, "%s", iComments2);
fprintf (asmFile, "; external stack \n");
copyFile (asmFile, xdata->oFile);
/* copy the interrupt vector table */
- if (mainf && mainf->fbody)
+ if (mainf && IFFUNC_HASBODY(mainf->type))
{
fprintf (asmFile, "%s", iComments2);
fprintf (asmFile, "; interrupt vector \n");
tfprintf (asmFile, "\t!area\n", port->mem.post_static_name);
tfprintf (asmFile, "\t!area\n", port->mem.static_name);
- if (mainf && mainf->fbody)
+ if (mainf && IFFUNC_HASBODY(mainf->type))
{
fprintf (asmFile, "__sdcc_gsinit_startup:\n");
/* if external stack is specified then the
}
copyFile (asmFile, statsg->oFile);
- if (port->general.glue_up_main && mainf && mainf->fbody)
+ if (port->general.glue_up_main && mainf && IFFUNC_HASBODY(mainf->type))
{
/* This code is generated in the post-static area.
* This area is guaranteed to follow the static area
fprintf (asmFile, "; code\n");
fprintf (asmFile, "%s", iComments2);
tfprintf (asmFile, "\t!areacode\n", CODE_NAME);
- if (mainf && mainf->fbody)
+ if (mainf && IFFUNC_HASBODY(mainf->type))
{
/* entry point @ start of CSEG */
tmpdir = getenv ("TMPDIR");
if (tmpdir)
{
- char *name = tempnam (tmpdir, "sdcc");
+ char *name = Safe_strdup( tempnam (tmpdir, "sdcc"));
if (name)
{
FILE *fp = fopen (name, "w+b");