mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-11-08 23:27:15 -05:00
nasm_warnf() -> nasm_warn()
We want to strongly encourage writers of warnings to create warning categories, so remove the flagless nasm_warn() and change nasm_warnf() to nasm_warn(). Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
@@ -593,13 +593,13 @@ static void aout_out(int32_t segto, const void *data,
|
||||
else if (segto == sbss.index)
|
||||
s = NULL;
|
||||
else {
|
||||
nasm_warn("attempt to assemble code in"
|
||||
nasm_warn(WARN_OTHER, "attempt to assemble code in"
|
||||
" segment %d: defaulting to `.text'", segto);
|
||||
s = &stext;
|
||||
}
|
||||
|
||||
if (!s && type != OUT_RESERVE) {
|
||||
nasm_warn("attempt to initialize memory in the"
|
||||
nasm_warn(WARN_OTHER, "attempt to initialize memory in the"
|
||||
" BSS section: ignored");
|
||||
sbss.len += realsize(type, size);
|
||||
return;
|
||||
@@ -609,7 +609,7 @@ static void aout_out(int32_t segto, const void *data,
|
||||
|
||||
if (type == OUT_RESERVE) {
|
||||
if (s) {
|
||||
nasm_warn("uninitialized space declared in"
|
||||
nasm_warn(WARN_OTHER, "uninitialized space declared in"
|
||||
" %s section: zeroing",
|
||||
(segto == stext.index ? "code" : "data"));
|
||||
aout_sect_write(s, NULL, size);
|
||||
|
||||
@@ -304,13 +304,13 @@ static void as86_out(int32_t segto, const void *data,
|
||||
else if (segto == bssindex)
|
||||
s = NULL;
|
||||
else {
|
||||
nasm_warn("attempt to assemble code in"
|
||||
nasm_warn(WARN_OTHER, "attempt to assemble code in"
|
||||
" segment %d: defaulting to `.text'", segto);
|
||||
s = &stext;
|
||||
}
|
||||
|
||||
if (!s && type != OUT_RESERVE) {
|
||||
nasm_warn("attempt to initialize memory in the"
|
||||
nasm_warn(WARN_OTHER, "attempt to initialize memory in the"
|
||||
" BSS section: ignored");
|
||||
bsslen += realsize(type, size);
|
||||
return;
|
||||
@@ -320,7 +320,7 @@ static void as86_out(int32_t segto, const void *data,
|
||||
|
||||
if (type == OUT_RESERVE) {
|
||||
if (s) {
|
||||
nasm_warn("uninitialized space declared in"
|
||||
nasm_warn(WARN_OTHER, "uninitialized space declared in"
|
||||
" %s section: zeroing",
|
||||
(segto == stext.index ? "code" : "data"));
|
||||
as86_sect_write(s, NULL, size);
|
||||
|
||||
@@ -746,7 +746,7 @@ static void bin_out(int32_t segto, const void *data,
|
||||
}
|
||||
|
||||
if ((s->flags & TYPE_NOBITS) && (type != OUT_RESERVE))
|
||||
nasm_warn("attempt to initialize memory in a"
|
||||
nasm_warn(WARN_OTHER, "attempt to initialize memory in a"
|
||||
" nobits section: ignored");
|
||||
|
||||
switch (type) {
|
||||
@@ -786,7 +786,7 @@ static void bin_out(int32_t segto, const void *data,
|
||||
|
||||
case OUT_RESERVE:
|
||||
if (s->flags & TYPE_PROGBITS) {
|
||||
nasm_warn("uninitialized space declared in"
|
||||
nasm_warn(WARN_OTHER, "uninitialized space declared in"
|
||||
" %s section: zeroing", s->name);
|
||||
saa_wbytes(s->contents, NULL, size);
|
||||
}
|
||||
@@ -967,7 +967,7 @@ static int bin_read_attribute(char **line, int *attribute,
|
||||
|
||||
/* Check for no value given. */
|
||||
if (!*exp) {
|
||||
nasm_warn("No value given to attribute in"
|
||||
nasm_warn(WARN_OTHER, "No value given to attribute in"
|
||||
" `section' directive");
|
||||
return -1;
|
||||
}
|
||||
@@ -1029,7 +1029,7 @@ static void bin_assign_attributes(struct Section *sec, char *astring)
|
||||
*astring = '\0';
|
||||
astring++;
|
||||
}
|
||||
nasm_warn("ignoring unknown section attribute: \"%s\"", p);
|
||||
nasm_warn(WARN_OTHER, "ignoring unknown section attribute: \"%s\"", p);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -1327,13 +1327,13 @@ bin_directive(enum directive directive, char *args, int pass)
|
||||
else { /* Must be a filename. */
|
||||
rf = nasm_open_write(p, NF_TEXT);
|
||||
if (!rf) {
|
||||
nasm_warn("unable to open map file `%s'", p);
|
||||
nasm_warn(WARN_OTHER, "unable to open map file `%s'", p);
|
||||
map_control = 0;
|
||||
return DIRR_OK;
|
||||
}
|
||||
}
|
||||
} else
|
||||
nasm_warn("map file already specified");
|
||||
nasm_warn(WARN_OTHER, "map file already specified");
|
||||
}
|
||||
if (map_control == 0)
|
||||
map_control |= MAP_ORIGIN | MAP_SUMMARY;
|
||||
|
||||
@@ -316,7 +316,7 @@ static int32_t coff_section_names(char *name, int pass, int *bits)
|
||||
*p++ = '\0';
|
||||
if (strlen(name) > 8) {
|
||||
if (!win32 && !win64) {
|
||||
nasm_warn("COFF section names limited to 8 characters: truncating");
|
||||
nasm_warn(WARN_OTHER, "COFF section names limited to 8 characters: truncating");
|
||||
name[8] = '\0';
|
||||
}
|
||||
}
|
||||
@@ -409,7 +409,7 @@ static int32_t coff_section_names(char *name, int pass, int *bits)
|
||||
|
||||
/* Warn if non-alignment flags differ */
|
||||
if ((flags ^ coff_sects[i]->flags) & ~IMAGE_SCN_ALIGN_MASK) {
|
||||
nasm_warn("section attributes ignored on"
|
||||
nasm_warn(WARN_OTHER, "section attributes ignored on"
|
||||
" redeclaration of section `%s'", name);
|
||||
}
|
||||
/* Check if alignment might be needed */
|
||||
@@ -579,7 +579,7 @@ static void coff_out(int32_t segto, const void *data,
|
||||
}
|
||||
|
||||
if (!s->data && type != OUT_RESERVE) {
|
||||
nasm_warn("attempt to initialize memory in"
|
||||
nasm_warn(WARN_OTHER, "attempt to initialize memory in"
|
||||
" BSS section `%s': ignored", s->name);
|
||||
s->len += realsize(type, size);
|
||||
return;
|
||||
@@ -603,7 +603,7 @@ static void coff_out(int32_t segto, const void *data,
|
||||
|
||||
if (type == OUT_RESERVE) {
|
||||
if (s->data) {
|
||||
nasm_warn("uninitialised space declared in"
|
||||
nasm_warn(WARN_OTHER, "uninitialised space declared in"
|
||||
" non-BSS section `%s': zeroing", s->name);
|
||||
coff_sect_write(s, NULL, size);
|
||||
} else
|
||||
|
||||
@@ -259,7 +259,7 @@ static void elf_section_attrib(char *name, char *attr, int pass,
|
||||
} else if (!nasm_stricmp(opt, "nobits")) {
|
||||
*type = SHT_NOBITS;
|
||||
} else if (pass == 1) {
|
||||
nasm_warn("Unknown section attribute '%s' ignored on"
|
||||
nasm_warn(WARN_OTHER, "Unknown section attribute '%s' ignored on"
|
||||
" declaration of section `%s'", opt, name);
|
||||
}
|
||||
opt = next;
|
||||
@@ -462,7 +462,7 @@ static int32_t elf_section_names(char *name, int pass, int *bits)
|
||||
if ((type && sects[i]->type != type)
|
||||
|| (align && sects[i]->align != align)
|
||||
|| (flags_and && ((sects[i]->flags & flags_and) != flags_or)))
|
||||
nasm_warn("incompatible section attributes ignored on"
|
||||
nasm_warn(WARN_OTHER, "incompatible section attributes ignored on"
|
||||
" redeclaration of section `%s'", name);
|
||||
}
|
||||
|
||||
@@ -820,7 +820,7 @@ static void elf32_out(int32_t segto, const void *data,
|
||||
/* end of debugging stuff */
|
||||
|
||||
if (s->type == SHT_NOBITS && type != OUT_RESERVE) {
|
||||
nasm_warn("attempt to initialize memory in"
|
||||
nasm_warn(WARN_OTHER, "attempt to initialize memory in"
|
||||
" BSS section `%s': ignored", s->name);
|
||||
s->len += realsize(type, size);
|
||||
return;
|
||||
@@ -829,7 +829,7 @@ static void elf32_out(int32_t segto, const void *data,
|
||||
switch (type) {
|
||||
case OUT_RESERVE:
|
||||
if (s->type == SHT_PROGBITS) {
|
||||
nasm_warn("uninitialized space declared in"
|
||||
nasm_warn(WARN_OTHER, "uninitialized space declared in"
|
||||
" non-BSS section `%s': zeroing", s->name);
|
||||
elf_sect_write(s, NULL, size);
|
||||
} else
|
||||
@@ -924,7 +924,7 @@ static void elf32_out(int32_t segto, const void *data,
|
||||
*! warns if 8-bit or 16-bit relocations are used in the \c{elf32} output format.
|
||||
*! The GNU extensions allow this.
|
||||
*/
|
||||
nasm_warnf(WARN_GNU_ELF_EXTENSIONS, "8- or 16-bit relocations "
|
||||
nasm_warn(WARN_GNU_ELF_EXTENSIONS, "8- or 16-bit relocations "
|
||||
"in ELF32 is a GNU extension");
|
||||
} else if (asize != 4 && segment != NO_SEG) {
|
||||
nasm_nonfatal("Unsupported non-32-bit ELF relocation");
|
||||
@@ -950,7 +950,7 @@ rel12adr:
|
||||
" segment base references");
|
||||
} else {
|
||||
if (wrt == NO_SEG) {
|
||||
nasm_warnf(WARN_GNU_ELF_EXTENSIONS, "8- or 16-bit relocations "
|
||||
nasm_warn(WARN_GNU_ELF_EXTENSIONS, "8- or 16-bit relocations "
|
||||
"in ELF is a GNU extension");
|
||||
elf_add_reloc(s, segment, 0, reltype);
|
||||
} else {
|
||||
@@ -1031,7 +1031,7 @@ static void elf64_out(int32_t segto, const void *data,
|
||||
/* end of debugging stuff */
|
||||
|
||||
if (s->type == SHT_NOBITS && type != OUT_RESERVE) {
|
||||
nasm_warn("attempt to initialize memory in"
|
||||
nasm_warn(WARN_OTHER, "attempt to initialize memory in"
|
||||
" BSS section `%s': ignored", s->name);
|
||||
s->len += realsize(type, size);
|
||||
return;
|
||||
@@ -1040,7 +1040,7 @@ static void elf64_out(int32_t segto, const void *data,
|
||||
switch (type) {
|
||||
case OUT_RESERVE:
|
||||
if (s->type == SHT_PROGBITS) {
|
||||
nasm_warn("uninitialized space declared in"
|
||||
nasm_warn(WARN_OTHER, "uninitialized space declared in"
|
||||
" non-BSS section `%s': zeroing", s->name);
|
||||
elf_sect_write(s, NULL, size);
|
||||
} else
|
||||
@@ -1309,7 +1309,7 @@ static void elfx32_out(int32_t segto, const void *data,
|
||||
/* end of debugging stuff */
|
||||
|
||||
if (s->type == SHT_NOBITS && type != OUT_RESERVE) {
|
||||
nasm_warn("attempt to initialize memory in"
|
||||
nasm_warn(WARN_OTHER, "attempt to initialize memory in"
|
||||
" BSS section `%s': ignored", s->name);
|
||||
s->len += realsize(type, size);
|
||||
return;
|
||||
@@ -1318,7 +1318,7 @@ static void elfx32_out(int32_t segto, const void *data,
|
||||
switch (type) {
|
||||
case OUT_RESERVE:
|
||||
if (s->type == SHT_PROGBITS) {
|
||||
nasm_warn("uninitialized space declared in"
|
||||
nasm_warn(WARN_OTHER, "uninitialized space declared in"
|
||||
" non-BSS section `%s': zeroing", s->name);
|
||||
elf_sect_write(s, NULL, size);
|
||||
} else
|
||||
|
||||
@@ -706,7 +706,7 @@ static int32_t ieee_segment(char *name, int pass, int *bits)
|
||||
ieee_idx++;
|
||||
if (!strcmp(seg->name, name)) {
|
||||
if (attrs > 0 && pass == 1)
|
||||
nasm_warn("segment attributes specified on"
|
||||
nasm_warn(WARN_OTHER, "segment attributes specified on"
|
||||
" redeclaration of segment: ignoring");
|
||||
if (seg->use32)
|
||||
*bits = 32;
|
||||
|
||||
@@ -1380,7 +1380,7 @@ static int32_t obj_segment(char *name, int pass, int *bits)
|
||||
|
||||
if (!strcmp(seg->name, name)) {
|
||||
if (attrs > 0 && pass == 1)
|
||||
nasm_warn("segment attributes specified on"
|
||||
nasm_warn(WARN_OTHER, "segment attributes specified on"
|
||||
" redeclaration of segment: ignoring");
|
||||
if (seg->use32)
|
||||
*bits = 32;
|
||||
@@ -1482,21 +1482,21 @@ static int32_t obj_segment(char *name, int pass, int *bits)
|
||||
case 4096: /* PharLap extension */
|
||||
break;
|
||||
case 8:
|
||||
nasm_warn("OBJ format does not support alignment"
|
||||
nasm_warn(WARN_OTHER, "OBJ format does not support alignment"
|
||||
" of 8: rounding up to 16");
|
||||
seg->align = 16;
|
||||
break;
|
||||
case 32:
|
||||
case 64:
|
||||
case 128:
|
||||
nasm_warn("OBJ format does not support alignment"
|
||||
nasm_warn(WARN_OTHER, "OBJ format does not support alignment"
|
||||
" of %d: rounding up to 256", seg->align);
|
||||
seg->align = 256;
|
||||
break;
|
||||
case 512:
|
||||
case 1024:
|
||||
case 2048:
|
||||
nasm_warn("OBJ format does not support alignment"
|
||||
nasm_warn(WARN_OTHER, "OBJ format does not support alignment"
|
||||
" of %d: rounding up to 4096", seg->align);
|
||||
seg->align = 4096;
|
||||
break;
|
||||
@@ -1534,7 +1534,7 @@ static int32_t obj_segment(char *name, int pass, int *bits)
|
||||
grp->segs[i] = grp->segs[grp->nindices];
|
||||
grp->segs[grp->nindices++].index = seg->obj_index;
|
||||
if (seg->grp)
|
||||
nasm_warn("segment `%s' is already part of"
|
||||
nasm_warn(WARN_OTHER, "segment `%s' is already part of"
|
||||
" a group: first one takes precedence",
|
||||
seg->name);
|
||||
else
|
||||
@@ -1649,7 +1649,7 @@ obj_directive(enum directive directive, char *value, int pass)
|
||||
grp->segs[grp->nentries++] = grp->segs[grp->nindices];
|
||||
grp->segs[grp->nindices++].index = seg->obj_index;
|
||||
if (seg->grp)
|
||||
nasm_warn("segment `%s' is already part of"
|
||||
nasm_warn(WARN_OTHER, "segment `%s' is already part of"
|
||||
" a group: first one takes precedence",
|
||||
seg->name);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user