summaryrefslogtreecommitdiff
path: root/output
diff options
context:
space:
mode:
authorH. Peter Anvin (Intel) <hpa@zytor.com>2018-12-14 13:33:24 -0800
committerH. Peter Anvin (Intel) <hpa@zytor.com>2018-12-14 13:33:24 -0800
commit80c4f23c52427382e455fd656bcbeeb60d725811 (patch)
treef1e7c328f89b01500d16ad857f171bc110be2206 /output
parent727c85263fd07dd2a4db77f17a2b2dfbdca79458 (diff)
downloadnasm-80c4f23c52427382e455fd656bcbeeb60d725811.tar.gz
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>
Diffstat (limited to 'output')
-rw-r--r--output/outaout.c6
-rw-r--r--output/outas86.c6
-rw-r--r--output/outbin.c12
-rw-r--r--output/outcoff.c8
-rw-r--r--output/outelf.c20
-rw-r--r--output/outieee.c2
-rw-r--r--output/outobj.c12
7 files changed, 33 insertions, 33 deletions
diff --git a/output/outaout.c b/output/outaout.c
index ccfda4dc..4eca36db 100644
--- a/output/outaout.c
+++ b/output/outaout.c
@@ -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);
diff --git a/output/outas86.c b/output/outas86.c
index 77fc18b8..4d2a92ab 100644
--- a/output/outas86.c
+++ b/output/outas86.c
@@ -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);
diff --git a/output/outbin.c b/output/outbin.c
index a3220e86..971b9cc0 100644
--- a/output/outbin.c
+++ b/output/outbin.c
@@ -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;
diff --git a/output/outcoff.c b/output/outcoff.c
index c2343151..3979d93f 100644
--- a/output/outcoff.c
+++ b/output/outcoff.c
@@ -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
diff --git a/output/outelf.c b/output/outelf.c
index 2adf4692..2f609c83 100644
--- a/output/outelf.c
+++ b/output/outelf.c
@@ -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
diff --git a/output/outieee.c b/output/outieee.c
index 30f38bc5..0078fa90 100644
--- a/output/outieee.c
+++ b/output/outieee.c
@@ -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;
diff --git a/output/outobj.c b/output/outobj.c
index 252ba3c8..9fd4ddca 100644
--- a/output/outobj.c
+++ b/output/outobj.c
@@ -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