Skip to content

Commit

Permalink
Whitelist or fix some compile-time warnings in recent clangs
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomif committed Aug 22, 2024
1 parent 7d987ce commit 0ec752d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fortune-mod/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ INCLUDE ("${CMAKE_SOURCE_DIR}/cmake/rinutils_bootstrap.cmake")
RINUTILS_SET_UP_FLAGS()

IF ("$ENV{FCS_CLANG}")
SET (_kept_sorted_whitelists "-Wno-cast-align -Wno-cast-qual -Wno-comma -Wno-declaration-after-statement -Wno-disabled-macro-expansion -Wno-documentation -Wno-documentation-deprecated-sync -Wno-documentation-unknown-command -Wno-extra-semi-stmt -Wno-gnu-statement-expression -Wno-implicit-fallthrough -Wno-language-extension-token -Wno-padded -Wno-pass-failed -Wno-unused-parameter -Wno-used-but-marked-unused -Wno-vla")
SET (_kept_sorted_whitelists "-Wno-cast-align -Wno-cast-qual -Wno-comma -Wno-declaration-after-statement -Wno-disabled-macro-expansion -Wno-documentation -Wno-documentation-deprecated-sync -Wno-documentation-unknown-command -Wno-extra-semi-stmt -Wno-gnu-statement-expression -Wno-implicit-fallthrough -Wno-language-extension-token -Wno-padded -Wno-pass-failed -Wno-unsafe-buffer-usage -Wno-unused-parameter -Wno-used-but-marked-unused -Wno-vla")
ADD_DEFINITIONS("-Weverything ${_kept_sorted_whitelists}")
# ADD_DEFINITIONS("-Weverything")
ENDIF ()
Expand Down
8 changes: 3 additions & 5 deletions fortune-mod/util/randstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,15 @@ static void get_fort(STRFILE fp)

static void display(FILE *fp, STRFILE table)
{
char *p, ch;
char line[BUFSIZ];
int i;

fseek(fp, (long)Seekpts[0], SEEK_SET);
for (i = 0; fgets(line, sizeof line, fp) && !STR_ENDSTRING(line, table);
i++)
for (; fgets(line, sizeof line, fp) && !STR_ENDSTRING(line, table);)
{
if (table.str_flags & STR_ROTATED)
{
for (p = line; (ch = *p); ++p)
char ch;
for (char *p = line; (ch = *p); ++p)
{
if (isupper(ch))
{
Expand Down

0 comments on commit 0ec752d

Please sign in to comment.