[m-rev.] fix bug 304, and some other issues

Julien Fischer jfischer at opturion.com
Sat Jan 18 04:25:56 AEDT 2014


Hi Zoltan,

This looks fine bar a few minor things noted below.  I have already committed a
more limited workaround for bug #304 on the 14.01 branch, but that has not
been merged back onto the master branch.

If you intend to commit these changes the 14.01 branch yourself, you should
remove the other workaround.  Otherwise, if you are only committing these
changes on the master branch I will deal with it when I merge these changes
onto the 14.01 branch.

On Fri, 17 Jan 2014, Zoltan Somogyi wrote:

> For review by anyone.
>
> I intend to commit these separately.
>
> Zoltan.
>

> Change 1:
> 
> configure.ac:
>     Fix two problems.
>
>     If the C compiler supports options to disable macro expansion tracking
>     and caret error messages, use them when using the constructs (labels,
>     i.e. goto targets) that would generate the messages we want to filter out.
>
>     Do not use environment variable values appropriate to the to-be-installed
>     Mercury compiler when testing the already-installed Mercury compiler.
> 
> Change 2:
> 
> RESERVED_MACRO_NAMES:
> */RESERVED_MACRO_NAMES:
>     Add a macro, _FORTIFY_SOURCE, that gcc defines by default on some recent
>     versions of Linux.
>
>     I could have added it in SIX separate RESERVED_MACRO_NAMES files.
>     Instead, I moved the content common to all these files to a
>     RESERVED_MACRO_NAMES file in the top directory, leaving the
>     RESERVED_MACRO_NAMES files of the subdirectories containing only
>     macros that *don't* occur in all those subdirectories.
> 
> tools/bootcheck:
>    Copy the top-level RESERVED_MACRO_NAMES names to the stage 2 directory.
> 
> Mmake.common.in:
>    Filter out the contents of the top level RESERVED_MACRO_NAMES file,
>    as well as the RESERVED_MACRO_NAMES file in the current directory.
> 
> Change 3:
> 
> util/info_to_doc.c:
>     Fix a problem that caused the generation of truncated mdb_doc files,
>     and from that truncated test/debugger/mdb_command_test.inp files.
>     The problem was that this program expected the info program to quote
>     the initial line of each mdb command like this:
>
>         `cmdname options ...'
>
>     but on some machines, including mine, it quotes them like this:
>
>         'cmdname options ...'
>
>     i.e. with the initial as well as the final quote being a forward quote.
>     This program now accepts either.
> 
> util/Mmakefile:
>     Fix white space.
> 
> doc/generate_mdb_doc:
>     Fix inconsistent indentation. Protect shell variable references.
> 
> doc/Mmakefile:
>     Generate an error message if a similar problem occurs again
>     when creating mdb_doc.
>
>     Fix indentation.
> 
> tools/bootcheck:
>     Generate an error message if a similar problem occurs again
>     when copying tests/debugger/mdb_command_test.inp.
> diff --git a/Mmake.common.in b/Mmake.common.in
> index 596705e..f378e27 100644
> --- a/Mmake.common.in
> +++ b/Mmake.common.in
> @@ -302,7 +302,8 @@ OBJ_CHECKS        = $(CHECK_OBJS:%=%.obj_check)
>  # 		is in a separate CVS module and is not included in the
>  # 		normal Mercury source distributions)
>  # Exceptions to this policy must be listed in the RESERVED_MACRO_NAMES file
> -# in the relevant directory.
> +# in the top directory (if applicable to all C source directories) or in
> +# the relevant directory (if applicable only to some C source directories)..

Delete the extra full stop there.

>  # XXX The base_typeclass_info prefix is allowed only temporarily; it should
>  # be fixed by adding a prefix giving the name of the module defining the
> @@ -368,7 +369,9 @@ OBJ_PREFIX_EXPRS   = \
>  	$(SSDB_OBJ_PREFIX_EXPRS)
>
>  HEADER_CLEAN_FILTER = \
> -	grep -v $(MACRO_PREFIX_EXPRS) | fgrep -v -x -f RESERVED_MACRO_NAMES
> +	grep -v $(MACRO_PREFIX_EXPRS) | \
> +      fgrep -v -x -f ../RESERVED_MACRO_NAMES | \
> +      fgrep -v -x -f RESERVED_MACRO_NAMES
>
>  # This rule checks that object files are properly namespace-clean, with
>  # regard to the global symbols that they define.

...

> index 07c5a18..670d972 100644
> --- a/configure.ac
> +++ b/configure.ac

...

>  #-----------------------------------------------------------------------------#
> @@ -905,6 +923,17 @@ cat > conftest.c << EOF
>      }
>  EOF
> 
> +AC_MSG_CHECKING(whether we can make error messages filterable)
> +if $CC -ftrack-macro-expansion=0 -fno-diagnostics-show-caret -c conftest.c \
> +    </dev/null >&AC_FD_CC 2>&1
> +then
> +    AC_MSG_RESULT(yes)
> +    CFLAGS_FOR_ERRMSG_FILTER="-ftrack-macro-expansion=0 -fno-diagnostics-show-caret"
> +else
> +    AC_MSG_RESULT(no)
> +    CFLAGS_FOR_ERRMSG_FILTER=""
> +fi
> +
>  AC_MSG_CHECKING(whether we can use -fno-move-loop-invariants)
>  if $CC -fno-move-loop-invariants -c conftest.c \
>      </dev/null >&AC_FD_CC 2>&1
> @@ -2572,6 +2601,8 @@ case "$C_COMPILER_TYPE" in
>          ;;
>  esac
> 
> +CFLAGS_FOR_GOTOS="$CFLAGS_FOR_GOTOS $CFLAGS_FOR_ERRMSG_FILTER"

Add a comment describing why we need to include the errmsg filter flags in
CFLAGS_FOR_GOTOS.

Cheers,
Julien.



More information about the reviews mailing list