質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
C

C言語は、1972年にAT&Tベル研究所の、デニス・リッチーが主体となって作成したプログラミング言語です。 B言語の後継言語として開発されたことからC言語と命名。そのため、表記法などはB言語やALGOLに近いとされています。 Cの拡張版であるC++言語とともに、現在世界中でもっとも普及されているプログラミング言語です。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

Q&A

解決済

1回答

1548閲覧

ソースからビルド時にコンパイルエラーでmakeが通らない

nishiys

総合スコア33

C

C言語は、1972年にAT&Tベル研究所の、デニス・リッチーが主体となって作成したプログラミング言語です。 B言語の後継言語として開発されたことからC言語と命名。そのため、表記法などはB言語やALGOLに近いとされています。 Cの拡張版であるC++言語とともに、現在世界中でもっとも普及されているプログラミング言語です。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

0グッド

0クリップ

投稿2018/10/04 09:37

編集2018/10/04 09:53

homebrewで
brew install px4-dev
の最中に、その依存パッケージである
kconfig-frontends
をインストールしようとしたところでサーバーエラーが出てインストールできなかったため、ソースからビルドすることにしました。

  1. 適当なディレクトリで以下を実行
$ git clone https://github.com/jameswalmsley/kconfig-frontends.git
  1. 以下を実行しようとしましたが、makeのところでエラーが出ます。
$ cd kconfig-frontends $ ./bootstrap $ ./configure $ make $ make install

##エラー内容

conf.c:77:10: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] printf(_("aborted!\n\n")); ^~~~~~~~~~~~~~~~~ ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^~~~~~~~~~~~~ conf.c:77:10: note: treat the string as an argument to avoid this printf(_("aborted!\n\n")); ^ "%s", ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^ conf.c:78:10: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] printf(_("Console input/output is redirected. ")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^~~~~~~~~~~~~ conf.c:78:10: note: treat the string as an argument to avoid this printf(_("Console input/output is redirected. ")); ^ "%s", ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^ conf.c:79:10: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] printf(_("Run 'make oldconfig' to update configuration.\n\n")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^~~~~~~~~~~~~ conf.c:79:10: note: treat the string as an argument to avoid this printf(_("Run 'make oldconfig' to update configuration.\n\n")); ^ "%s", ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^ conf.c:89:10: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] printf(_("(NEW) ")); ^~~~~~~~~~~ ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^~~~~~~~~~~~~ conf.c:89:10: note: treat the string as an argument to avoid this printf(_("(NEW) ")); ^ "%s", ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^ conf.c:290:12: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] printf(_(" (NEW)")); ^~~~~~~~~~~ ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^~~~~~~~~~~~~ conf.c:290:12: note: treat the string as an argument to avoid this printf(_(" (NEW)")); ^ "%s", ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^ conf.c:438:13: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] printf(_("*\n* Restart config...\n*\n")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^~~~~~~~~~~~~ conf.c:438:13: note: treat the string as an argument to avoid this printf(_("*\n* Restart config...\n*\n")); ^ "%s", ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^ conf.c:635:6: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] _("\n*** The configuration requires explicit update.\n\n")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^~~~~~~~~~~~~ conf.c:635:6: note: treat the string as an argument to avoid this _("\n*** The configuration requires explicit update.\n\n")); ^ "%s", ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^ conf.c:687:20: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^~~~~~~~~~~~~ conf.c:687:20: note: treat the string as an argument to avoid this fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n")); ^ "%s", ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^ conf.c:691:20: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] fprintf(stderr, _("\n*** Error during update of the configuration.\n\n")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^~~~~~~~~~~~~ conf.c:691:20: note: treat the string as an argument to avoid this fprintf(stderr, _("\n*** Error during update of the configuration.\n\n")); ^ "%s", ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^ conf.c:702:20: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^~~~~~~~~~~~~ conf.c:702:20: note: treat the string as an argument to avoid this fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n")); ^ "%s", ../../libs/parser/lkc.h:36:17: note: expanded from macro '_' #define _(text) gettext(text) ^ 10 errors generated. make[2]: *** [conf-conf.o] Error 1 make[1]: *** [check-recursive] Error 1 make: *** [check-recursive] Error 1

共通して、cのソースコードのprintfのところでコンパイルエラーとなっていると思うのですが、どのような対処をすれば良いでしょうか?

mac OS High Sierra 10.13.6

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

./configure CFLAGS="-Wno-format-security"
で、どうでしょうか

投稿2018/10/04 16:01

asm

総合スコア15147

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

nishiys

2018/10/04 23:00

ご回答ありがとうございます。無事makeが通りました!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問