3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

qrintfをつかってmruby-onig-regexpをビルドするには

Last updated at Posted at 2015-07-12

CC=qrintf clangだとエラーが出た

libtool: compile:  clang-qrintf -DHAVE_CONFIG_H -I. -I. -I/usr/local/include -MT regerror.lo -MD -MP -MF .deps/regerror.Tpo -c regerror.c -o regerror.o
In file included from regerror.c:37:
/usr/lib/llvm-3.6/bin/../lib/clang/3.6.0/include/varargs.h:25:4: error: "Please use <stdarg.h> instead of <varargs.h>"
  #error "Please use <stdarg.h> instead of <varargs.h>"
   ^
regerror.c:263:3: error: too few arguments provided to function-like macro invocation
  va_init_list(vargs, code);
  ^
regerror.c:38:37: note: expanded from macro 'va_init_list'
#define va_init_list(a,b) va_start(a)
                                    ^
/usr/lib/llvm-3.6/bin/../lib/clang/3.6.0/include/stdarg.h:33:9: note: macro 'va_start' defined here
#define va_start(ap, param) __builtin_va_start(ap, param)
        ^
regerror.c:335:3: error: too few arguments provided to function-like macro invocation
  va_init_list(args, fmt);
  ^
regerror.c:38:37: note: expanded from macro 'va_init_list'
#define va_init_list(a,b) va_start(a)
                                    ^
/usr/lib/llvm-3.6/bin/../lib/clang/3.6.0/include/stdarg.h:33:9: note: macro 'va_start' defined here
#define va_start(ap, param) __builtin_va_start(ap, param)
        ^
3 errors generated.
make[2]: *** [regerror.lo] Error 1

暫定対処方法

./configure時はCC=clang
で行い、作成されたMakfefileのCC=の指定を

CC=qrintf clang

と変更して、make

何が原因なのか

CC=qrintf clangだと

checking for qrintf clang option to accept ISO C89... unsupported

CC=clangだと

checking for clang option to accept ISO C89... none needed

このオプションがunsupportedだとC89以前のコンパイラと判定され、
前述のエラー中のvarargs.hが使われて、va_系の古き良き時代のコードがビルド対象となる模様。

初めは、qrintf clangとスペースが入っているのと、名称が気になり、clang-qrintfなるシェルスクリプトを作って、これをCCに指定したが変わらず。もちろんclang-qrintfコマンドでフツーにコンパルできる事は確認。

autoconfのISO C89関連のオプション検出の処理(ac_cv_prog_cc_c89)になにか問題があるのか、qrintfが何かこの検出処理に影響を与えているのかのいずれかだとは思う。

参考資料

関連記事

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?