--no-ansi (mgnuc) and --no-ansi-c (mmc) have not actually done anything for
many years now. Deprecate these options and remove their "use" throughout most
of the Mercury system. (The remaining uses are in the Makefiles for the Boehm
GC, which need to be updated separately.)
Also deprecate the internal compiler option --cflags-for-ansi.
compiler/options.m:
Document that --no-ansi-c is now deprecated.
Document that the internal option --cflags-for-ansi is now
deprecated.
compiler/compile_target_code.m:
Do not pass the ANSI options to the C compiler.
scripts/mgnuc.in:
scripts/mgnuc_file_opts.sh-subr:
Deprecate the --no-ansi option; delete code that no longer does
anything useful.
configure.ac:
Delete the configuration variable CFLAGS_FOR_ANSI; it is only ever
set to be empty. (The comment talks about --no-ansi doing other things
in the mgnuc script. It used to also cause some preprocessor macros
to be defined for compatibility with the system headers on some
platforms -- that has not been the case since 2013.)
doc/user_guide.texi:
Document that --no-ansi-c is deprecated.
bytecode/Mmakefile:
compiler/Mercury.options:
library/Mercury.options:
extras/odbc/odbc.m:
runtime/Mmakefile:
scripts/Mercury.config.bootstrap.in:
scripts/Mercury.config.in:
tests/hard_coded/Mercury.options:
tests/valid/Mercury.options:
trace/Mmakefile:
util/Mmakefile:
Conform to the above change.
NEWS.md:
Announce the above.
When building the ODBC binding as a library, name it libmercury_odbc, rather
than libodbc; unixODBC uses the former name, which is at the very least
confusing and appears to the source of linker errors on some platforms.
extras/odbc/mercury_odbc.m:
An empty module importing odbc, that is used to force the library
name to be libmercury_odbc instead of libodbc.
extras/odbc/Mmakefile:
Do not warn about the module we use force the library name not exporting
anything.
Delete a workaround for really old versions of GCC.
Discussion of these changes can be found on the Mercury developers
mailing list archives from June 2018.
COPYING.LIB:
Add a special linking exception to the LGPL.
*:
Update references to COPYING.LIB.
Clean up some minor errors that have accumulated in copyright
messages.
This file-specific setting will override a default setting of expandtabs
in $HOME/.vimrc.
*/Makefile:
*/Mmakefile:
As above.
tests/hard_coded/.gitignore:
Don't ignore the purity subdir. This ignore must have been left over
from when purity.m was a test in hard_coded, not hard_coded/purity,
and it ignored an executable, not a directory.
Branches: main
More fixes and cleanups for the ODBC binding.
extras/odbc/odbc.m:
Avoid C compiler warnings about the signedness of integer (and character)
types differing.
Use a Mercury bool/0 type to indicate that a transaction has thrown a
(Mercury) exception instead of passing integers across the C interface
do the same.
Define odbc.connection/0 as a foreign type rather than as a
c_pointer. This avoids some unnecessary casting. (Strictly speaking,
the existing definition was incorrect anyway since nothing in ODBC
guarantees that the type SQLHDBC will fit in a pointer.)
Make static functions that are referenced from the body of foreign
procs extern; add the prefix "odbc_" to their names where this was
not already present.
Use MR_external_fatal_error() rather than MR_fatal_error() as the
former does not report the error as occurring in the Mercury runtime.
Branches: main
More fixes and cleanups for the ODBC binding.
extras/odbc/odbc.m:
Avoid C compiler warnings about the signedness of integer (and character)
types differing.
Use a Mercury bool/0 type to indicate that a transaction has thrown a
(Mercury) exception instead of passing integers across the C interface
do the same.
Define odbc.connection/0 as a foreign type rather than as a
c_pointer. This avoids some unnecessary casting. (Strictly speaking,
the existing definition was incorrect anyway since nothing in ODBC
guarantees that the type SQLHDBC will fit in a pointer.)
Make static functions that are referenced from the body of foreign
procs extern; add the prefix "odbc_" to their names where this was
not already present.
Use MR_external_fatal_error() rather than MR_fatal_error() as the
former does not report the error as occurring in the Mercury runtime.
Branches: main
Some fixes for the ODBC binding.
extras/odbc/odbc.m:
Fix a compilation error: s/String/MR_String/ - the former no longer
exists.
Many things that were declared with static linkage in this module
can actually be referred to by from other object files if
--intermodule-optimisation is enabled and a foreign_proc referring
to them is inlined across module boundaries. Change the linkage
to external in places where this can happen.
Add a feature set pragma that requires conservative GC; the error
message for this is more friendly than when the C code finally
fails to compile.
Estimated hours taken: 1
Branches: main
Use `pragma foreign_export' in preference to `pragma export' throughout
the Mercury distribution.
Convert more of the extras distribution to four-space indentation and
other minor cleanups.
browser/*.m:
library/*.m:
samples/*:
extras/*:
As above.
Estimated hours taken: 6
Branches: main
A major cleanup of the ODBC binding. This is incorporates fixes for a number
of problems pointed out by Keri Harris the other day plus some fixes for some
other problems I encountered while working on it.
Also, add support for unixODBC to the ODBC binding.
extras/odbc/odbc.m:
extras/odbc/odbc_test.m:
Convert to four-space indentation throughout.
Use the new foreign-language interface throughout.
Make the type odbc.statement into a foreign_type. This cuts
down on the amount of casting required in the C code.
Use '.' as a module qualifier throughout.
Avoid unnecessary module qualification. Rename some local predicates
to help with this.
Fix places where we don't conform to the C or Mercury coding
standards.
Add support for unixODBC.
Don't use cast expressions as lvalues.
Add missing character escapes.
Avoid warnings about stat shadowing a global declaration.
extras/odbc/Mmakefile:
Support MODBC_UNIX (unixODBC) as a legal value for MODBC_DRIVER.
Remove a link to an old installation of iODBC.
Add the MLLIBS options necessary for building the ODBC binding
on Debian with either iODBC or unixODBC. (I've left the Windows
specific stuff intact, but I have no idea if it works or not.)
Estimated hours taken: 0.5
Branches: main
Fix compilation problems in the extras distribution caused by recent
changes.
extras/stream/stream.m:
Provide a definition for the type stream/1.
extras/*/*.m:
Conform to the recent changes to the standard library.
Estimated hours taken: 3
Branches: main
Deprecate old-style lambda expressions properly.
compiler/make_hlds.m:
Emit a warning if an old-style lambda expression is
encountered.
compiler/notes/todo.html:
Remove this from the TODO list.
compiler/base_typeclass_info.m:
compiler/mercury_to_mercury.m:
extras/odbc/odbc.m:
tests/*/*.m:
Replace old-style lambda expressions as necessary.
Estimated hours taken: 0.1
Branches: main
Fix some compilation errors in the ODBC interface.
extras/odbc/odbc.m:
Module qualify cons/3 because it now clashes with
list.cons/3.
Estimated hours taken: 3
Branches: main, release
Fix a problem where different packages in the `extras' distribution
were being installed in different directories when you specified
INSTALL_PREFIX in the Mmake.params file. Some honoured the INSTALL_PREFIX
setting, some appended "/extras", and some ignored it completely.
Also, add `clean' and `realclean' targets for the extras directory hierarchy,
and fix a few other minor bugs.
extras/lazy_evaluation/Mmakefile:
Include Mmake.params, which previously wasn't included at all
in this file.
extras/logged_output/Mmakefile:
extras/odbc/Mmakefile:
extras/quickcheck/Mmakefile:
Append "/extras" to INSTALL_PREFIX, which previously wasn't done
at all in these directories.
extras/cgi/Mmakefile:
extras/complex_numbers/Mmakefile:
extras/concurrency/Mmakefile:
extras/curs/Mmakefile:
extras/curses/Mmakefile:
extras/dynamic_linking/Mmakefile:
extras/moose/Mmakefile:
extras/posix/Mmakefile:
Move the line `INSTALL_PREFIX := $(INSTALL_PREFIX/extras)'
to before the include of Mmake.params, so as not to override
the user's setting (only override the default setting).
extras/Mmakefile:
extras/concurrency/Mmakefile:
Add `clean' and `realclean' targets.
extras/posix/Mmakefile:
Add MGNUCFLAGS = --no-ansi, since this is needed on some systems.
extras/quickcheck/Mmakefile:
Add "depend", "all", and "install" targets.
Ensure that the "check" target runs the test program.
extras/quickcheck/qcheck.m:
Set the exit status to non-zero if a test fails.
extras/references/Mmakefile:
Adjust the setting of LIBGRADES to account for the fact that
$(GRADE) is no longer implicitly included in $(LIBGRADES).
Estimated hours taken: 0.1
Branches: main
extras/odbc/odbc.m:
Patch submitted by Michael Cameron <mcam@csse.monash.edu.au> to get the
ODBC interface working with recent versions of the runtime system.
Estimated hours taken: 4
Branches: main
Add MR_ prefixes to the remaining non-prefixed symbols.
This change will require all workspaces to be updated
The compiler will start generating references to MR_TRUE,
MR_bool, etc., which are not defined in the old runtime
header files.
runtime/mercury_std.h:
Add MR_ prefixes to bool, TRUE, FALSE, max, min,
streq, strdiff, strtest, strntest, strneq, strndiff,
strntest, NO_RETURN.
Delete a commented out definition of `reg'.
runtime/mercury_tags.h:
Add an MR_ prefix to TAGBITS.
configure.in:
runtime/mercury_goto.h:
runtime/machdeps/i386_regs.h/mercury_goto.h:
Add an MR_ prefix to PIC.
runtime/mercury_conf_param.h:
Allow non-prefixed PIC and HIGHTAGS to be defined on
the command line.
runtime/mercury_bootstrap.h:
Add backwards compatibility definitions.
RESERVED_MACRO_NAMES:
Remove the renamed macros.
compiler/export.m:
compiler/ml_code_gen.m:
Use MR_bool rather than MR_Bool (MR_Bool is
meant to be for references to the Mercury type
bool__bool).
runtime/mercury_types.h:
Add a comment the MR_Bool is for references to
bool__bool.
*/*.c:
*/*.h:
*/*.m:
Add MR_ prefixes.
Estimated hours taken: 2.5
Branches: main
Add MR_ prefixes to uses of configuration macros.
Bootcheck now succeeds with MR_NO_CONF_BACKWARDS_COMPAT.
Mmake.common.in:
Define MR_NO_CONF_BACKWARDS_COMPAT when checking
for namespace cleanliness.
RESERVED_MACRO_NAMES:
Remove the configuration macros.
runtime/mercury_conf_bootstrap.h:
Remove a duplicate definition of BOXED_FLOAT.
configure.in:
*/*.c:
*/*.h:
*/*.m:
Add MR_ prefixes.
Estimated hours taken: 4
Optionally test the extras directory during bootchecks.
tools/bootcheck
Add an option, -e, for testing the extras directory. Rename the
-T/--test-only option as -n/--no-bootcheck, since it does not prevent
the testing of the extras.
Bootcheck only test the subdirectories in extras which have an
Mmakefile and which can be tested in all grades and in all setups.
extras/*/Mmakefile:
Updates to include extras/Mmake.params if it exists (to get the
parameters, including grades, of the bootcheck) and to add a check
target, which in most cases does not do anything yet (which means
that the only testing we do is checking that the program compiles
all right). Making "mmake check" do something meaningful will be
up to the authors of the various subdirectories involved.
In many cases, add .PHONY annotations on the relevant targets,
and copyright notices.
extras/aditi/NOBOOTTEST:
Prevent the automatic testing of the aditi subdirectory from
bootcheck, since this can be done only on a machine with Aditi
installed.
extras/aditi/NOBOOTTEST:
Prevent the automatic testing of the aditi subdirectory from
bootcheck, since this can be done only on a machine with Aditi
installed.
extras/aditi/NOBOOTTEST:
Prevent the automatic testing of this subdirectory from bootcheck,
since this can be done only on a machine with Aditi installed.
extras/dynamic_linking/NOBOOTTEST:
Prevent the automatic testing of this subdirectory from bootcheck,
since this can be done only on a machine with the dl library already
installed.
extras/logged_out/NOBOOTTEST:
Prevent the automatic testing of this subdirectory from bootcheck,
since this can be done only in grades with the right kind of stream
support.
extras/odbc/NOBOOTTEST:
Prevent the automatic testing of this subdirectory from bootcheck,
since this can be done only on a machine with ODBC installed.
extras/references/NOBOOTTEST:
extras/trailed_update/NOBOOTTEST:
Prevent the automatic testing of this subdirectory from bootcheck,
since this can be done only in trailing grades.
extras/*/.nocopyright:
Mention the NOBOOTTEST files in the relevant .nocopyright files.
Estimated hours taken: 0.1
extras/aditi/aditi.m:
extras/odbc/odbc.m:
Use `#error "message"' rather than just `#error message'.
The rationale for this is (a) consistency with what we do elsewhere in
the Mercury implementation and (b) one of the C compilers that we were
using at one point in the Mercury project did not conform to the
ANSI/ISO C standard in this respect and reported an error if the
message in a `#error' declaration was not in quotes, even if it was
#ifdef'd out.
Estimated hours taken: 2
Handle exceptions thrown by the closure passed to odbc__transaction.
extras/odbc/odbc.m:
Abort the transaction if the closure throws an exception,
and rethrow the exception to the caller.
extras/odbc/odbc_test.m:
Add a transaction which throws an exception to the test.
extras/odbc/Mmakefile:
Minor changes to the set-up for iODBC 2.50.3.
Estimated hours taken: 4
Update odbc library.
This code now works with iODBC 2.50 (which is nice because it will
ship with Debian 2.2). I have tested it and managed to retrieve all
of a reasonably large database from MySQL without problems.
Some errors introduced by fjh in his memory allocation cleanup have been
fixed too.
extras/odbc/odbc.m:
Remove some of the work arounds for bugs in iOBDC 2.12 since
they have been fixed in iODBC 2.50.
Include std_util in the interface (since we use pair).
Use MR_GC_NEW and MR_GC_NEW_ARRAY to allocate statements
and rows. These allocations have to match the deallocations
later that are done with MR_GC_free. It might be better to
allocate statements and rows using normal malloc, but this
approach is conservative and works fine. It may need to be
revisited if this module is made to work with accurate GC.
Estimated hours taken: 8
Reorganize the routines for allocating and deallocating memory:
runtime/mercury_std.h:
runtime/mercury_misc.c:
runtime/mercury_memory.h:
runtime/mercury_memory.c:
- Put the routines in the proper place.
Previously the declarations and definitions of the memory
allocation/deallocation routines were spread amoungst
all four of these files; I moved the ones in mercury_std.h
and mercury_misc.c so that they are now all defined
in mercury_memory.{h,c}
- Avoid unnecessary duplication
The following routines did exactly the same thing,
modulo bugs(!):
allocate_bytes() and newmem()
deallocate_bytes() and oldmem()
make() and allocate_object()
make_many() and allocate_array()
- Use appropriate names.
I added `MR_' prefixes, and ensured that macros that are not
function-like macros use all uppercase. I also used a more
consistent naming scheme.
Previously the names used were
(1) checked_malloc, checked_realloc
(2a) allocate_bytes, deallocate_bytes, reallocate_bytes,
allocate_object, allocate_array, resize_array
(2b) newmem, oldmem, resizemem,
make, make_many, resize_many
The new names are
(1) MR_malloc, MR_free, MR_realloc,
MR_NEW, MR_NEW_ARRAY, MR_RESIZE_ARRAY
(2) MR_GC_malloc, MR_GC_free, MR_GC_realloc,
MR_GC_NEW, MR_GC_NEW_ARRAY, MR_GC_RESIZE_ARRAY
runtime/*.[ch]:
trace/*.[ch]:
library/array.m:
library/benchmarking.m:
library/io.m:
library/std_util.m:
extras/odbc/odbc.m:
extras/aditi/aditi.m:
Use the new names.
Estimated hours taken: 3
Prefix everything defined in runtime/mercury_{stacks,tags}.h MR_.
In the process, get rid of the grade component MR_DEBUG_NONDET_STACK,
since this makes the update to mercury_stacks.h simpler and its use is
long obsolete.
runtime/mercury_tags.h:
Put MR_ prefixes in front of everything defined here.
runtime/mercury_stacks.h:
Put MR_ prefixes in front of everything defined here.
Remove support for MR_DEBUG_NONDET_STACK. Replace most of the
lost functionality by calling an updated mkframe_msg.
Remove the definitions of push() and pop(). Their use conflicts with
the idea that everything on the det stack is part of a frame, which
the RTTI stuff depends on.
runtime/mercury_bootstrap.h:
Add backward compatibility macros for the old names in the above two
files.
Remove some old entries in this file which are no longer needed.
runtime/mercury_wrapper.c:
Remove the only uses of push() and pop().
Put MR_ in front of some things that need them.
runtime/mercury_engine.c:
Put MR_ in front of some things that need them.
runtime/mercury_misc.[ch]:
Make mkframe_msg get the name of the procedure that owns the stack
frame from an explicitly passed argument, rather than the prednm slot
(which no longer exists). This actually improves low-level debugging
support without MR_DEBUG_NONDET_STACK.
Remove unnecessary return statements.
runtime/mercury_debug.h:
Pass on the new arg of mkframe_msg.
Fix long lines.
runtime/mercury_conf_param.h:
Remove the documentation of MR_DEBUG_NONDET_STACK.
runtime/mercury_grade.h:
Remove the grade component of MR_DEBUG_NONDET_STACK.
doc/reference_manual.texi:
Document the MR_ prefixed versions of list_empty, list_cons etc.
library/io.m:
library/std_util.m:
library/string.m:
Add prefixes to some references to the runtime.
Estimated hours taken: 0.25
extras/odbc/odbc.m:
Update the reference to the paper on database transactions
to include the published version, and to include the URL of
the cover page of the tech report.
Estimated hours taken: 0.5
extras/odbc/odbc.m:
Add a definition for __stdcall so that the Microsoft ODBC
headers will compile under gcc with fewer patches.
Estimated hours taken: 1
Improve the ODBC interface slightly.
extras/odbc/odbc.m
Rename odbc__execute/4 as odbc__solutions/4.
Add odbc__aggregate/6 similar to std_util:unsorted_aggregate/4.
NEWS
Document the ODBC interface.
runtime/engine.h
runtime/engine.mod
Add wrappers around longjmp and setjmp which save and restore
some state in engine.c and the Mercury registers.
runtime/mercury_trail.h
Add a macro MR_IF_USE_TRAIL which evaluates to its argument
if MR_USE_TRAIL is defined, or to nothing otherwise.
runtime/mercury_string.h
Add a macro make_aligned_string_copy to copy a C string
onto the Mercury heap.
runtime/misc.c
Avoid a seg-fault when printing out info about the nondet stack
in a debug grade.
extras/odbc/Mmakefile
extras/odbc/odbc.m
The interface.
extras/odbc/odbc_test.m
A simple test.