-Wall์ ์ฌ์ฉํ์ฌ gcc๋ฅผ 7.1.1๋ก ์
๋ฐ์ดํธํ ํ ์ปดํ์ผ๋ฌ ๊ฒฝ๊ณ ๊ฐ ํ์๋ฉ๋๋ค.
https://github.com/glfw/glfw/blob/master/src/linux_joystick.c#L169
๊ฒฝ๋ก ๊ธธ์ด๋ 20์ผ๋ก ์ค์ ๋์ง๋ง ์ ์ฌ์ ์ผ๋ก 256 + dirname ๋ฌธ์ ๊ธธ์ด๋ฅผ ํฌํจํ ์ ์์ต๋๋ค.
์ด๊ฒ์ 3.2.1๊ณผ ๊ด๋ จ์ด ์์ง๋ง ์ด ์ค์ด ๋ณ๊ฒฝ๋์ง ์์์ผ๋ฏ๋ก ์ฌ์ ํ ์ ํจํด์ผ ํฉ๋๋ค.
๊ทธ๋ฐ ๊ฒฝ๊ณ ๋ฅผ ์์ ๋ ค๊ณ ํ๋์ง ํ์คํ์ง ์์ต๋๋ค.
glfw/src/linux_joystick.c:224:46: warning: โ%sโ directive output may be truncated writing up to 255 bytes into a region of size 19 [-Wformat-truncation=]
snprintf(path, sizeof(path), "%s/%s", dirname, entry->d_name);
glfw/src/linux_joystick.c:224:13: note: โsnprintfโ output 2 or more bytes (assuming 257) into a destination of size 20
snprintf(path, sizeof(path), "%s/%s", dirname, entry->d_name);
๊ทธ๋ฐ ๊ฒฝ๊ณ ๋ฅผ ์์ ๋ ค๊ณ ํ๋์ง ํ์คํ์ง ์์ต๋๋ค.
๊ทธ๋ ๋ค! ์ ์ด๋ -Wall์ ๋ชจ๋ ๊ฒ.
์์ฒญ๋. ๋๋ ํฌ๊ธฐ๋ฅผ 512๋ก ๋๋ ค์ ๋ก์ปฌ์์ ๊ณ ์ณค์ต๋๋ค. ํ์ง๋ง ์กฐ์ด์คํฑ์ด ์๊ณ ์ด๋์์๋ ๋ถ์์ฉ์ด ์๋์ง์ ๋ํ ๋จ์๊ฐ ์์ต๋๋ค...
์ ์ ํ ์๋ฃจ์
์๋ pathconf
๋๋ asnprintf
ํฌํจ๋ ๊ฒ์
๋๋ค.
๋ฌธ์ ๋ ์ฌ์ ํ ์กด์ฌํฉ๋๋ค.
/home/dertarr/Downloads/glfw-3.2.1/src/linux_joystick.c: In function โ_glfwInitJoysticksLinuxโ:
/home/dertarr/Downloads/glfw-3.2.1/src/linux_joystick.c:224:46: warning: โ%sโ directive output may be truncated writing up to 255 bytes into a region of size 19 [-Wformat-truncation=]
snprintf(path, sizeof(path), "%s/%s", dirname, entry->d_name);
^~
/home/dertarr/Downloads/glfw-3.2.1/src/linux_joystick.c:224:13: note: โsnprintfโ output 2 or more bytes (assuming 257) into a destination of size 20
snprintf(path, sizeof(path), "%s/%s", dirname, entry->d_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@dertarr ์์ ํจ์น๋ 3.2.1 ๋ฆด๋ฆฌ์ค ์ดํ์ ์ ์ฉ๋ ๊ฒ์ ๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๋ฌธ์ ๋ ์ฌ์ ํ ์กด์ฌํฉ๋๋ค.