Commit Graph

7 Commits

Author SHA1 Message Date
Zoltan Somogyi
2315f1660e Replace /* */ comments with // comments in util.
util/mdemangle.c:
util/mfiltercc.c:
util/mkinit_common.c:
util/pad_backslash.c:
    As above. The other .c files in util already used // comments.
2023-03-19 00:16:22 +11:00
Julien Fischer
6851f943ec Avoid C compiler warnings that occur when using clang with -Wall.
Except where noted otherwise below most of these warnings relate to implicit
conversions between 64- and 32-bit integers or the signedness of integers
differing in spots.

library/construct.m:
	Delete an unused local variable in the implementation of get_functor_lex.

library/bitmap.m:
	The function MR_bitmap_cmp returns an MR_Integer not an int.

library/thread.semaphore.m:
	Change the count field of the ML_SEMAPHORE_STRUCT structure into
	an MR_Integer (which is what gets passed in).

trace/mercury_trace_declarative.c:
	Avoid a warning about fprintf being called where its second argument
	is not a string literal.  (In this case it can be replaced by a call
	to fputs.)

library/io.m:
mdbcomp/rtti_access.m:
trace/mercury_trace.c:
trace/mercury_trace_cmd_breakpoint.c:
trace/mercury_trace_cmd_help.c:
trace/mercury_trace_completion.m:
trace/mercury_trace_declarative.[ch]:
trace/mercury_trace_external.c:
trace/mercury_trace_internal.c:
trace/mercury_trace_source.c:
trace/mercury_trace_tables.c:
trace/mercury_trace_vars.c:
util/info_to_mdb.c:
util/mfiltercc.c:
util/mdemangle.c:
util/mkinit.c:
util/mkinit_erl.c:
util/mkinit_common.h:
util/mkinit_common.c:
	As above.
2014-03-31 00:31:36 +11:00
Zoltan Somogyi
b902f5cf60 Minor style cleanups.
Estimated hours taken: 0.5
Branches: main

util/*.c:
	Minor style cleanups.
2012-06-05 16:16:47 +00:00
Peter Wang
a7bac78bf9 Suppress spurious "used but never defined" warnings from gcc 4.6+.
Branches: main, 11.07

Suppress spurious "used but never defined" warnings from gcc 4.6+.
Fixes bug #250.

util/mfiltercc.c:
	Update `drop_line' to match the error message from newer versions of
	gcc, which add a suffix to the message.

	Allow the same message for non-Mercury-generated functions to pass
	through.
2012-05-10 00:12:08 +00:00
Julien Fischer
99d591f126 Avoid warnings from the mgnuc script on MinGW, Cygwin and Solaris when
Branches: main, 10.04

Avoid warnings from the mgnuc script on MinGW, Cygwin and Solaris when
compiling the source distribution.  The warnings are from the "which" command,
which is used in the mgnuc script when checking for the presence of the
mfiltercc utility program.  (If the command named in the argument to which
cannot be found on the above systems it fails rather noisily rather than just
setting a non-zero exist status as on Linux and Mac OS X.)

The solution is to ensure that mfiltercc is built before anything that requires
it.

Mmakefile:
	Add a new top-level target util_no_rt that builds those programs in the
	util directory that do not depend on anything in the runtime directory.

scripts/mgnuc.in:
scripts/mgnuc_file_opt.sh-subr:
	Add a new option, --no-filter-cc, that tells mgnuc not to bother
	filtering the warning output of the C compiler.

util/Makefile:
	Compile mfiltercc with --no-filter-cc since for the source distribution
	it obviously won't exist until we do compile it.

util/mfiltercc.c:
	Add a note at the top of this file mentioning the requirement that it
	not depend on anything in the runtime directory.
2010-12-07 07:50:29 +00:00
Julien Fischer
237dc9e5de Increase the maximum line length handled by this program since
Branches: main, 10.04

util/mfiltercc.c:
	Increase the maximum line length handled by this program since
	the current value is exceeded by the length of some warnings
	generated at -O5 --intermod-opt.
2010-07-11 14:17:57 +00:00
Peter Wang
6ad6d12260 Filter out warning message from gcc 4.x which are emitted when compiling
Branches: main, 10.04

Filter out warning message from gcc 4.x which are emitted when compiling
low-level C code using assembler labels, at least until a better fix is
available.

util/Mmakefile:
util/mfiltercc.c:
        Add a new program, mfiltercc.

compiler/options.m:
        Add `--filtercc-command' option (undocumented).

compiler/compile_target_code.m:
        Filter compiler output with mfiltercc if using assembler labels.

scripts/mgnuc.in:
        Filter compiler output with mfiltercc if using assembler labels, but
        only if mfiltercc can be found on the $PATH.  The bootstrap compiler
        may not have mfiltercc.

.mercury-compiler.spec.in:
Makefile:
README.MinGW:
bindist/Mmakefile:
bindist/bindist.Makefile.in:
scripts/mercury_config.in:
        Mention mfiltercc in various places.
2010-07-09 07:10:16 +00:00