Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implicit declaration error #3

Open
nobu-g opened this issue Nov 16, 2020 · 3 comments
Open

implicit declaration error #3

nobu-g opened this issue Nov 16, 2020 · 3 comments

Comments

@nobu-g
Copy link
Member

nobu-g commented Nov 16, 2020

Mac でコンパイル時に次のような implicit declaration error が複数出力される

case_analysis.c:1078:5: error: implicit declaration of function 'bnst_to_tag_tree' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    bnst_to_tag_tree(sp);

macOS Bug Sur (11.0.1)

$ clang -v
Apple clang version 12.0.0 (clang-1200.0.32.27)
Target: x86_64-apple-darwin20.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
@nobu-g
Copy link
Member Author

nobu-g commented Nov 16, 2020

clang のエラー検出の default 設定が厳しくなっているよう
WORKAROUND: ./configure CFLAGS=-w

@eiennohito
Copy link

eiennohito commented Nov 16, 2020

おそらく、それよりは --std=c89 でコンパイルしたほうがいいです。
複数のコンパイラーでデフォルトが Cの場合は --std=gnu99 になって、C++の場合は --std=c++14 です。
もともとの定義を直したほうがいいかもしれませんけど

@nobu-g
Copy link
Member Author

nobu-g commented Nov 16, 2020

./configure CFLAGS=--std=c89 としてコンパイルしてみましたが、implicit declaration error で失敗します。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants