bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* argmatch: fix compilation errors
@ 2019-06-30 19:12 Bruno Haible
  0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2019-06-30 19:12 UTC (permalink / raw)
  To: bug-gnulib

Hi Akim,

My weekly continuous-integration test fails. These are the compilation errors:


In file included from test-argmatch.c:22:0:
test-argmatch.c: In function 'argmatch_backup_usage':
../gllib/argmatch.h:284:52: error: 'INT_MAX' undeclared (first use in this function)
     const int screen_width = getenv ("HELP2MAN") ? INT_MAX : 80;        \
                                                    ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
../gllib/argmatch.h:284:52: note: each undeclared identifier is reported only once for each function it appears in
     const int screen_width = getenv ("HELP2MAN") ? INT_MAX : 80;        \
                                                    ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
In file included from test-argmatch.c:26:0:
test-argmatch.c: In function 'main':
test-argmatch.c:107:13: error: too few arguments to function 'argmatch_backup_value'
     ASSERT (argmatch_backup_value (Input) == Output);                   \
             ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:119:3: note: in expansion of macro 'CHECK'
   CHECK ("klingon", -1);
   ^
In file included from test-argmatch.c:22:0:
../gllib/argmatch.h:236:3: note: declared here
   argmatch_##Name##_value (const char *context, const char *arg)        \
   ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
In file included from test-argmatch.c:26:0:
test-argmatch.c:111:18: warning: implicit declaration of function 'argmatch_backup_xvalue' [-Wimplicit-function-declaration]
         ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
                  ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:119:3: note: in expansion of macro 'CHECK'
   CHECK ("klingon", -1);
   ^
test-argmatch.c:111:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:119:3: note: in expansion of macro 'CHECK'
   CHECK ("klingon", -1);
   ^
test-argmatch.c:112:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test",                        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:119:3: note: in expansion of macro 'CHECK'
   CHECK ("klingon", -1);
   ^
test-argmatch.c:107:13: error: too few arguments to function 'argmatch_backup_value'
     ASSERT (argmatch_backup_value (Input) == Output);                   \
             ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:122:3: note: in expansion of macro 'CHECK'
   CHECK ("none", 1);
   ^
In file included from test-argmatch.c:22:0:
../gllib/argmatch.h:236:3: note: declared here
   argmatch_##Name##_value (const char *context, const char *arg)        \
   ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
In file included from test-argmatch.c:26:0:
test-argmatch.c:111:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:122:3: note: in expansion of macro 'CHECK'
   CHECK ("none", 1);
   ^
test-argmatch.c:112:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test",                        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:122:3: note: in expansion of macro 'CHECK'
   CHECK ("none", 1);
   ^
test-argmatch.c:107:13: error: too few arguments to function 'argmatch_backup_value'
     ASSERT (argmatch_backup_value (Input) == Output);                   \
             ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:123:3: note: in expansion of macro 'CHECK'
   CHECK ("nil", 7);
   ^
In file included from test-argmatch.c:22:0:
../gllib/argmatch.h:236:3: note: declared here
   argmatch_##Name##_value (const char *context, const char *arg)        \
   ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
In file included from test-argmatch.c:26:0:
test-argmatch.c:111:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:123:3: note: in expansion of macro 'CHECK'
   CHECK ("nil", 7);
   ^
test-argmatch.c:112:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test",                        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:123:3: note: in expansion of macro 'CHECK'
   CHECK ("nil", 7);
   ^
test-argmatch.c:107:13: error: too few arguments to function 'argmatch_backup_value'
     ASSERT (argmatch_backup_value (Input) == Output);                   \
             ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:126:3: note: in expansion of macro 'CHECK'
   CHECK ("nilpotent", -1);
   ^
In file included from test-argmatch.c:22:0:
../gllib/argmatch.h:236:3: note: declared here
   argmatch_##Name##_value (const char *context, const char *arg)        \
   ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
In file included from test-argmatch.c:26:0:
test-argmatch.c:111:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:126:3: note: in expansion of macro 'CHECK'
   CHECK ("nilpotent", -1);
   ^
test-argmatch.c:112:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test",                        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:126:3: note: in expansion of macro 'CHECK'
   CHECK ("nilpotent", -1);
   ^
test-argmatch.c:107:13: error: too few arguments to function 'argmatch_backup_value'
     ASSERT (argmatch_backup_value (Input) == Output);                   \
             ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:129:3: note: in expansion of macro 'CHECK'
   CHECK ("simpl", 3);
   ^
In file included from test-argmatch.c:22:0:
../gllib/argmatch.h:236:3: note: declared here
   argmatch_##Name##_value (const char *context, const char *arg)        \
   ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
In file included from test-argmatch.c:26:0:
test-argmatch.c:111:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:129:3: note: in expansion of macro 'CHECK'
   CHECK ("simpl", 3);
   ^
test-argmatch.c:112:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test",                        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:129:3: note: in expansion of macro 'CHECK'
   CHECK ("simpl", 3);
   ^
test-argmatch.c:107:13: error: too few arguments to function 'argmatch_backup_value'
     ASSERT (argmatch_backup_value (Input) == Output);                   \
             ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:130:3: note: in expansion of macro 'CHECK'
   CHECK ("simp", 3);
   ^
In file included from test-argmatch.c:22:0:
../gllib/argmatch.h:236:3: note: declared here
   argmatch_##Name##_value (const char *context, const char *arg)        \
   ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
In file included from test-argmatch.c:26:0:
test-argmatch.c:111:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:130:3: note: in expansion of macro 'CHECK'
   CHECK ("simp", 3);
   ^
test-argmatch.c:112:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test",                        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:130:3: note: in expansion of macro 'CHECK'
   CHECK ("simp", 3);
   ^
test-argmatch.c:107:13: error: too few arguments to function 'argmatch_backup_value'
     ASSERT (argmatch_backup_value (Input) == Output);                   \
             ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:131:3: note: in expansion of macro 'CHECK'
   CHECK ("sim", 3);
   ^
In file included from test-argmatch.c:22:0:
../gllib/argmatch.h:236:3: note: declared here
   argmatch_##Name##_value (const char *context, const char *arg)        \
   ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
In file included from test-argmatch.c:26:0:
test-argmatch.c:111:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:131:3: note: in expansion of macro 'CHECK'
   CHECK ("sim", 3);
   ^
test-argmatch.c:112:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test",                        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:131:3: note: in expansion of macro 'CHECK'
   CHECK ("sim", 3);
   ^
test-argmatch.c:107:13: error: too few arguments to function 'argmatch_backup_value'
     ASSERT (argmatch_backup_value (Input) == Output);                   \
             ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:134:3: note: in expansion of macro 'CHECK'
   CHECK ("numbered", 9);
   ^
In file included from test-argmatch.c:22:0:
../gllib/argmatch.h:236:3: note: declared here
   argmatch_##Name##_value (const char *context, const char *arg)        \
   ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
In file included from test-argmatch.c:26:0:
test-argmatch.c:111:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:134:3: note: in expansion of macro 'CHECK'
   CHECK ("numbered", 9);
   ^
test-argmatch.c:112:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test",                        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:134:3: note: in expansion of macro 'CHECK'
   CHECK ("numbered", 9);
   ^
test-argmatch.c:107:13: error: too few arguments to function 'argmatch_backup_value'
     ASSERT (argmatch_backup_value (Input) == Output);                   \
             ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:135:3: note: in expansion of macro 'CHECK'
   CHECK ("numbere", -2);
   ^
In file included from test-argmatch.c:22:0:
../gllib/argmatch.h:236:3: note: declared here
   argmatch_##Name##_value (const char *context, const char *arg)        \
   ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
In file included from test-argmatch.c:26:0:
test-argmatch.c:111:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:135:3: note: in expansion of macro 'CHECK'
   CHECK ("numbere", -2);
   ^
test-argmatch.c:112:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test",                        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:135:3: note: in expansion of macro 'CHECK'
   CHECK ("numbere", -2);
   ^
test-argmatch.c:107:13: error: too few arguments to function 'argmatch_backup_value'
     ASSERT (argmatch_backup_value (Input) == Output);                   \
             ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:136:3: note: in expansion of macro 'CHECK'
   CHECK ("number", -2);
   ^
In file included from test-argmatch.c:22:0:
../gllib/argmatch.h:236:3: note: declared here
   argmatch_##Name##_value (const char *context, const char *arg)        \
   ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
In file included from test-argmatch.c:26:0:
test-argmatch.c:111:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:136:3: note: in expansion of macro 'CHECK'
   CHECK ("number", -2);
   ^
test-argmatch.c:112:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test",                        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:136:3: note: in expansion of macro 'CHECK'
   CHECK ("number", -2);
   ^
test-argmatch.c:107:13: error: too few arguments to function 'argmatch_backup_value'
     ASSERT (argmatch_backup_value (Input) == Output);                   \
             ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:137:3: note: in expansion of macro 'CHECK'
   CHECK ("numbe", -2);
   ^
In file included from test-argmatch.c:22:0:
../gllib/argmatch.h:236:3: note: declared here
   argmatch_##Name##_value (const char *context, const char *arg)        \
   ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
In file included from test-argmatch.c:26:0:
test-argmatch.c:111:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:137:3: note: in expansion of macro 'CHECK'
   CHECK ("numbe", -2);
   ^
test-argmatch.c:112:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test",                        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:137:3: note: in expansion of macro 'CHECK'
   CHECK ("numbe", -2);
   ^
test-argmatch.c:107:13: error: too few arguments to function 'argmatch_backup_value'
     ASSERT (argmatch_backup_value (Input) == Output);                   \
             ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:138:3: note: in expansion of macro 'CHECK'
   CHECK ("numb", -2);
   ^
In file included from test-argmatch.c:22:0:
../gllib/argmatch.h:236:3: note: declared here
   argmatch_##Name##_value (const char *context, const char *arg)        \
   ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
In file included from test-argmatch.c:26:0:
test-argmatch.c:111:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:138:3: note: in expansion of macro 'CHECK'
   CHECK ("numb", -2);
   ^
test-argmatch.c:112:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test",                        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:138:3: note: in expansion of macro 'CHECK'
   CHECK ("numb", -2);
   ^
test-argmatch.c:107:13: error: too few arguments to function 'argmatch_backup_value'
     ASSERT (argmatch_backup_value (Input) == Output);                   \
             ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:139:3: note: in expansion of macro 'CHECK'
   CHECK ("num", -2);
   ^
In file included from test-argmatch.c:22:0:
../gllib/argmatch.h:236:3: note: declared here
   argmatch_##Name##_value (const char *context, const char *arg)        \
   ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
In file included from test-argmatch.c:26:0:
test-argmatch.c:111:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:139:3: note: in expansion of macro 'CHECK'
   CHECK ("num", -2);
   ^
test-argmatch.c:112:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test",                        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:139:3: note: in expansion of macro 'CHECK'
   CHECK ("num", -2);
   ^
test-argmatch.c:107:13: error: too few arguments to function 'argmatch_backup_value'
     ASSERT (argmatch_backup_value (Input) == Output);                   \
             ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:140:3: note: in expansion of macro 'CHECK'
   CHECK ("nu", -2);
   ^
In file included from test-argmatch.c:22:0:
../gllib/argmatch.h:236:3: note: declared here
   argmatch_##Name##_value (const char *context, const char *arg)        \
   ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
In file included from test-argmatch.c:26:0:
test-argmatch.c:111:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:140:3: note: in expansion of macro 'CHECK'
   CHECK ("nu", -2);
   ^
test-argmatch.c:112:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test",                        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:140:3: note: in expansion of macro 'CHECK'
   CHECK ("nu", -2);
   ^
test-argmatch.c:107:13: error: too few arguments to function 'argmatch_backup_value'
     ASSERT (argmatch_backup_value (Input) == Output);                   \
             ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:141:3: note: in expansion of macro 'CHECK'
   CHECK ("n", -2);
   ^
In file included from test-argmatch.c:22:0:
../gllib/argmatch.h:236:3: note: declared here
   argmatch_##Name##_value (const char *context, const char *arg)        \
   ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
In file included from test-argmatch.c:26:0:
test-argmatch.c:111:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:141:3: note: in expansion of macro 'CHECK'
   CHECK ("n", -2);
   ^
test-argmatch.c:112:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test",                        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:141:3: note: in expansion of macro 'CHECK'
   CHECK ("n", -2);
   ^
test-argmatch.c:107:13: error: too few arguments to function 'argmatch_backup_value'
     ASSERT (argmatch_backup_value (Input) == Output);                   \
             ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:144:3: note: in expansion of macro 'CHECK'
   CHECK ("ne", -2);
   ^
In file included from test-argmatch.c:22:0:
../gllib/argmatch.h:236:3: note: declared here
   argmatch_##Name##_value (const char *context, const char *arg)        \
   ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
In file included from test-argmatch.c:26:0:
test-argmatch.c:111:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:144:3: note: in expansion of macro 'CHECK'
   CHECK ("ne", -2);
   ^
test-argmatch.c:112:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test",                        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:144:3: note: in expansion of macro 'CHECK'
   CHECK ("ne", -2);
   ^
test-argmatch.c:107:13: error: too few arguments to function 'argmatch_backup_value'
     ASSERT (argmatch_backup_value (Input) == Output);                   \
             ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:147:3: note: in expansion of macro 'CHECK'
   CHECK ("si", 3);
   ^
In file included from test-argmatch.c:22:0:
../gllib/argmatch.h:236:3: note: declared here
   argmatch_##Name##_value (const char *context, const char *arg)        \
   ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
In file included from test-argmatch.c:26:0:
test-argmatch.c:111:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:147:3: note: in expansion of macro 'CHECK'
   CHECK ("si", 3);
   ^
test-argmatch.c:112:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test",                        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:147:3: note: in expansion of macro 'CHECK'
   CHECK ("si", 3);
   ^
test-argmatch.c:107:13: error: too few arguments to function 'argmatch_backup_value'
     ASSERT (argmatch_backup_value (Input) == Output);                   \
             ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:148:3: note: in expansion of macro 'CHECK'
   CHECK ("s", 3);
   ^
In file included from test-argmatch.c:22:0:
../gllib/argmatch.h:236:3: note: declared here
   argmatch_##Name##_value (const char *context, const char *arg)        \
   ^
test-argmatch.c:62:1: note: in expansion of macro 'ARGMATCH_DEFINE_GROUP'
 ARGMATCH_DEFINE_GROUP(backup, enum backup_type);
 ^
In file included from test-argmatch.c:26:0:
test-argmatch.c:111:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:148:3: note: in expansion of macro 'CHECK'
   CHECK ("s", 3);
   ^
test-argmatch.c:112:17: error: invalid type argument of unary '*' (have 'int')
         ASSERT (*argmatch_backup_xvalue ("test",                        \
                 ^
macros.h:57:13: note: in definition of macro 'ASSERT'
       if (!(expr))                                                           \
             ^
test-argmatch.c:148:3: note: in expansion of macro 'CHECK'
   CHECK ("s", 3);
   ^
Makefile:19953: recipe for target 'test-argmatch.o' failed
make[4]: *** [test-argmatch.o] Error 1


And indeed I get these errors also through a simple command:
  $ ./gnulib-tool --test argmatch


This patch fixes it. Assuming it's uncontroversial, I'm pushing it:


2019-06-30  Bruno Haible  <bruno@clisp.org>

	argmatch: Fix compilation errors.
	* lib/argmatch.h: Include <limits.h>, for INT_MAX.
	* tests/test-argmatch.c (main): Update after last-minute function names
	change.

diff --git a/lib/argmatch.h b/lib/argmatch.h
index 46a452c..d185499 100644
--- a/lib/argmatch.h
+++ b/lib/argmatch.h
@@ -22,6 +22,7 @@
 #ifndef ARGMATCH_H_
 # define ARGMATCH_H_ 1
 
+# include <limits.h>
 # include <stdbool.h>
 # include <stddef.h>
 # include <stdio.h>
diff --git a/tests/test-argmatch.c b/tests/test-argmatch.c
index 0d19e97..11b5819 100644
--- a/tests/test-argmatch.c
+++ b/tests/test-argmatch.c
@@ -104,13 +104,13 @@ main (int argc, char *argv[])
 #define CHECK(Input, Output)                                            \
   do {                                                                  \
     ASSERT (ARGMATCH (Input, backup_args, backup_vals) == Output);      \
-    ASSERT (argmatch_backup_value (Input) == Output);                   \
+    ASSERT (argmatch_backup_choice (Input) == Output);                  \
     if (0 <= Output)                                                    \
       {                                                                 \
         enum backup_type val = argmatch_backup_args[Output].val;        \
-        ASSERT (*argmatch_backup_xvalue ("test", Input) == val);        \
-        ASSERT (*argmatch_backup_xvalue ("test",                        \
-                                         argmatch_backup_argument (&val)) \
+        ASSERT (*argmatch_backup_value ("test", Input) == val);         \
+        ASSERT (*argmatch_backup_value ("test",                         \
+                                        argmatch_backup_argument (&val)) \
                 == val);                                                \
       }                                                                 \
   } while (0)



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-06-30 19:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-30 19:12 argmatch: fix compilation errors Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).