Linuxにatinoutをインストールする方法

Linuxにatinoutをインストールする方法

私はLinuxに初めて触れ、この問題に直面しました。使用を推奨するUSSDコマンドを実行しようとしていますが、そのatinoutページを確認してみるとインストール方法が見つからないようです。私はzipファイルを次からダウンロードしました。ソースフォージ、これはatinout-0.9.1

走ってみようmake動作しているかどうかはわかりませんが、) 以下の出力を取得します。

gcc -o atinout -W -Wall -Wextra -Werror -DVERSION=\"0.9.1\" -g  atinout.c
atinout.c: In function ‘is_final_result’:
atinout.c:141:6: error: this statement may fall through [-Werror=implicit-fallthrough=]
  141 |   if (strcmp(&response[1], "K\r\n") == 0) {
      |      ^
atinout.c:145:2: note: here
  145 |  default:
      |  ^~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:14: atinout] Error 1

誰でも私を案内できますか?ありがとうございます。

ベストアンサー1

GCC 9.3.0でも同じエラーが発生します。 1つの可能な修正方法は、-WerrorMakefileから次の行を削除することです。

CFLAGS = -W -Wall -Wextra -Werror \

したがって、次のようになります。

CFLAGS = -W -Wall -Wextra \

atinoutが開発されたとき、GCCはまだ暗黙の失敗警告を持っていないか(2016年にコミット81fea426da8でのみ実装されています)、それをコンパイルするために他のコンパイラが使用されている可能性があります。

別の回避策は、別のコンパイラを試してみることです。たとえば、clang 10.0.1では警告やエラーは表示されません。

$ make CC=clang
clang -o atinout -W -Wall -Wextra -Werror -DVERSION=\"0.9.1\" -g  atinout.c

どちらの場合も、現在の作業ディレクトリに atinout が表示されます。

$ ./atinout --version
atinout version 0.9.1
Copyright (C) 2013 Håkon Løvdal <[email protected]>
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under
certain conditions; see http://www.gnu.org/licenses/gpl.html for details.

おすすめ記事