When using the LEA instruction with immediate syntax instead of memory
operand syntax, the IP_REL flag will not have made it into the operand
type. Make it do so.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
defining->dstk.mmac should point back to "defining" when the topmost
definition block is a %macro block.
Otherwise %00 will not inhibit label emission.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
With -Lb, it is possible that we don't have a filename for the current
code expansion. In that case, suppress calling dfmt->linenum as some
debug backends *really* aren't equipped to handle that case.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
If the segment number changes, we also need to invoke dfmt->linenum(),
as a .nolist macro may end up emitting to more than one section.
This also adds the source location explicitly to the output data
structure; the cost for that is minimal, and will enable a more
sophisticated debug backend to receive the entire data structure in
the future.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
If -std=c17 and -std=c11 don't work, try -std=c99 as well.
-std=c90 is unlikely to work because of the requirement for "long
long" on L32 platforms, which isn't likely to be supported on a pure
C90 compiler.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
If the compiler supports it, use -std=c17 or -std=c11. Hopefully, this
will give us more predictable behavior in some cases.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
With some combinations of options tests for typeof, snprintf, and
vsnprintf end up with warnings promoted to errors, which then trigger
incorrect results for these tests. Move the typeof test to the end,
and write specific tests for snprintf and vsnprintf.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
printf("%d", <size_t>) is invalid. As this is for legacy compilers,
don't rely on %zu but rather cast to unsigned long long.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Update the table used by pass_type() to give the name of the pass
type. It was not updated properly after PASS_PREPROC was added.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Disable the %pragma list options in k_test.asm to avoid nasty
surprises. LISTOPT is -L+ by default and can be overridden on the
command line, so the %pragma is not just unnecessary but problematic.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
config/unconfig.h is build from config/config.h.in, but the latter
doesn't exist in the repository either. config/unconfig.h is cleaner,
so check it back into the repository, to let non-Unix-sh people be
able to build from the repo.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
NASM would incorrectly only allow for the alignment to be increased,
even when overridden by the user. Allow the user to specify any
alignment value and have it override the partition type default.
The user can increade their own alignment value specification later,
of course, and the sectalign directive will present a floor for either
kind of specification.
Reported-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Still technically not defined behavior, but this *should* work on all
reasonable or semi-reasonable systems.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Commit 6d36d8684 added a wrong break statement to case 'x'
in rdflib.c::main() at line235. That case 'x' must "fall
through" into case 't' which re-checks the argument.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Commit 8dc965347 removed writing of the timestamp size to library
header. (Accidentally, I guess??) The attached patch adds it back.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
- config/watcom.h: update.
- Mkfiles/openwcom.mak: -wcd=124 to silence "Comparison result always 0"
warnings from error.h::debug_level()
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
If the C compiler has typeof(), we can use a safer implementation of
the offsetin() macro by using typeof(). Since typeof() isn't standard
(yet?) autoconf has to test for it.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
The -enable-... option to enable -ftrivial-auto-var-init=zero breaks
linking not just on clang but on other compilers (gcc) too. Drop it;
this feature is enabled by default in clang 10.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
config/unconfig.h really is no different than the other perlreq files,
so move it into the Makefile. This has the extra advantage that
config/unconfig.h no longer needs to be kept in the source repository.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
It is a bit confusing when the alloc_size attribute is tested for more
than once, to include the arguments in the output message.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
The clang behavior is sometimes really weird, and extremely hard to
debug, when uninitialized variables are used even if the value cancels
out in an expression. It also depends on optimization level, etc.
-ftrivial-auto-var-init=zero makes the behavior
predictable. Unfortunately it also needs a really weird "enable"
option, and it issues a warning about an unused command line option on
link, which may get promoted to error, so silence the warning before
doing anything else.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
If a format is specified explicitly for the debug format, it needs to
be "debug", not "dbg". Lovely inconsistency.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
The %line directives in weirdpaste.i now better reflect the actual
lines of the source code, just as we would have for debugging
output. Update the reference version of weirdpaste.i accordingly.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
%+ tokens can end up next to each other, or at the beginning or the
end of an expansion if we try to paste the output of empty
macros. This is perhaps particularly likely to happen in %[]
expressions.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
1. Error messages would issue with the line number of %endrep.
2. Debug line information would ignore both macros and reps.
This is doubly wrong; macros are semantically equivalent to
inline functions, and it is expected that debuggers trace
into these functions.
These changes finishes the last parts of moving all responsibility for
the listing enable/disable into the preprocessor, so remove the
way over-complicated macro inhibit facility from the listing module
entirely.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
In preproc-only mode, we only ever execute a single pass, so we need
to still issue error messages created during that pass, otherwise we
don't even generate %warning or %error messages...
Reported-by: Jason Hood <jadoxa@yahoo.com.au>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
It appears that at least with the Adobe Source fonts:
'hyphen' -> U+002D (ASCII)
'minus' -> U+2212
This is ugly for cut & paste purposes.
Reported-by: C. Masloch <pushbx@ulukai.org>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
The mailinglists have been migrated to lists.nasm.us
Signed-off-by: Jasper Lievisse Adriaanse <j@jasper.la>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Move the safe_alloc declaration after the * symbol to be consistent
with all other functions with this attribute. Just in case it matters
somewhere...
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
The autoconf process automatically generates macros for function
attributes, including empty placeholders. Said empty placeholders also
propagate automatically into config/unconfig.h for the compilers which
don't support autoconf.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>