This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] document IntegerRange in internals manual

A conflict in my patch for bug 81345 made me notice that r249734
recently added a new option property, IntegerRange.  The change
below adds brief documentation of the property to the manual.

Martin, can you please check to make sure I didn't miss anything?

Btw., while experimenting with the property I noticed that there
is no error when option that specifies IntegerRange is set in
the .opt file to a value outside that range.  Would it be hard
to add some checks the the awk scripts to validate that the
argument values are in the range?  It might help avoid bugs
similar to 81345).

By the way of an example, the following invalid specification
is accepted but then causes errors when GCC runs.

C ObjC C++ ObjC++ Warning Alias(Wfoobar=, 1, 0)

C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_foobar) Warning LangEnabledBy(C ObjC C++ ObjC++, Wall, 2, 0) Init (7) IntegerRange(3, 5)


diff --git a/gcc/doc/options.texi b/gcc/doc/options.texi
index 3b68aab..af56e9f 100644
--- a/gcc/doc/options.texi
+++ b/gcc/doc/options.texi
@@ -264,6 +264,12 @@ option handler. @code{UInteger} should also be used on options like
 @code{-falign-loops}=@var{n} are supported to make sure the saved
 options are given a full integer.

+@item IntegerRange(@var{min}, @var{max})
+The option's integer argument is expected to be in the range specified
+by @var{min} and @var{max}, inclusive.  The option parser will check
+and reject option arguments that are outside the range before passing
+it to the relevant option handler.
 @item ToLower
 The option's argument should be converted to lowercase as part of
 putting it in canonical form, and before comparing with the strings

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]