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에서도 같은 오류가 발생합니다. 한 가지 가능한 수정 방법은 -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.

관련 정보