]> granicus.if.org Git - re2c/commitdiff
Documentation: added warning descriptions to '-h, -?, --help' option.
authorUlya Trofimovich <skvadrik@gmail.com>
Thu, 17 Sep 2015 14:03:24 +0000 (15:03 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Thu, 17 Sep 2015 14:03:24 +0000 (15:03 +0100)
re2c/src/conf/msg.cc

index 6b5fe03e80755cba6776ee8e763ba1fc79a950a6..6a94b266d7ff0348c7c53d3bcf683a8d590a071f 100644 (file)
@@ -151,9 +151,59 @@ void usage ()
        "                        e.g: [], [^\\x00-\\xFF], [\\x00-\\xFF]\\[\\x00-\\xFF].\n"
        "\n"
        "-1     --single-pass    Deprecated and does nothing (single pass is by default now).\n"
+       "\n"
+       "-W                      Turn on all warnings.\n"
+       "\n"
+       "-Werror                 Turn warnings into errors. Note that this option along doesn't\n"
+       "                        turn on any warnings, it only affects those warnings that have\n"
+       "                        been turned on so far or will be turned on later.\n"
+       "\n"
+       "-W<warning>             Turn on individual warning.\n"
+       "\n"
+       "-Wno-<warning>          Turn off individual warning.\n"
+       "\n"
+       "-Werror-<warning>       Turn on individual warning and treat it as error (this implies\n"
+       "                        '-W<warning>').\n"
+       "\n"
+       "-Wno-error-<warning>    Don't treat this particular warning as error. This doesn't turn\n"
+       "                        off the warning itself.\n"
+       "\n"
+       "Warnings:\n"
+       "\n"
+       "-Wcondition-order       Warn if the generated program makes implicit assumptions about\n"
+       "                        condition numbering. One should use either '-t, --type-header'\n"
+       "                        option or '/*!types:re2c*/' directive to generate mapping of\n"
+       "                        condition names to numbers and use autogenerated condition names.\n"
+       "\n"
+       "-Wempty-character-class Warn if regular expression contains empty character class. From\n"
+       "                        the rational point of view trying to match empty character class\n"
+       "                        makes no sense: it should always fail. However, for backwards\n"
+       "                        compatibility reasons re2c allows empty character class and treats\n"
+       "                        it as empty string. Use '--empty-class' option to change default\n"
+       "                        behaviour.\n"
+       "\n"
+       "-Wmatch-empty-string    Warn if regular expression in a rule is nullable (matches empty\n"
+       "                        string). If DFA runs in a loop and empty match is unintentional\n"
+       "                        (input position in not advanced manually), lexer may get stuck\n"
+       "                        in eternal loop.\n"
+       "\n"
+       "-Wswapped-range         Warn if range lower bound is greater that upper bound. Default\n"
+       "                        re2c behaviour is to silently swap range bounds.\n"
+       "\n"
+       "-Wundefined-control-flow\n"
+       "                        Warn if some input strings cause undefined control flow in lexer\n"
+       "                        (the faulty patterns are reported). This is the most dangerous\n"
+       "                        and common mistake. It can be easily fixed by adding default rule\n"
+       "                        '*' (this rule has the lowest priority, matches any code unit\n"
+       "                        and consumes exactly one code unit).\n"
+       "\n"
+       "-Wuseless-escape        Warn if a symbol is escaped when it shouldn't be. By default re2c\n"
+       "                        silently ignores escape, but this may as well indicate a typo\n"
+       "                        or an error in escape sequence.\n"
+       "\n"
        );
 }
+
 void vernum ()
 {
        std::string vernum (PACKAGE_VERSION);