Changeset dd7df1c in mainline


Ignore:
Timestamp:
2023-10-22T17:26:17Z (13 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dcef1127
Parents:
71b4444
git-author:
Vojtech Horky <vojtech.horky@…> (2023-07-14 09:54:21)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-22 17:26:17)
Message:

Silence spurious/unwanted GCC warnings using pragmas

Location:
uspace
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/fault/fault1.c

    r71b4444 rdd7df1c  
    3030#include "../tester.h"
    3131
     32#pragma GCC diagnostic ignored "-Warray-bounds"
     33
    3234const char *test_fault1(void)
    3335{
  • uspace/app/tester/print/print5.c

    r71b4444 rdd7df1c  
    3838 */
    3939#pragma GCC diagnostic ignored "-Wformat"
     40#pragma GCC diagnostic ignored "-Wformat-overflow"
    4041
    4142#include <stdio.h>
  • uspace/lib/c/generic/rtld/symbol.c

    r71b4444 rdd7df1c  
    135135        modules_untag(start->rtld);
    136136
    137         /* Insert root (the program) into the queue and tag it */
     137        /*
     138         * Insert root (the program) into the queue and tag it.
     139         *
     140         * We disable the dangling-pointer warning because the compiler incorrectly
     141         * assumes that we leak local address (queue) to a parent scope (to start
     142         * argument). However, we always empty the list so the pointer cannot
     143         * actually escape. Probably the compiler can never statically analyze that
     144         * correctly.
     145         */
    138146        list_initialize(&queue);
    139147        start->bfs_tag = true;
     148#pragma GCC diagnostic push
     149#if defined(__GNUC__) && (__GNUC__ >= 12)
     150#pragma GCC diagnostic ignored "-Wdangling-pointer"
     151#endif
    140152        list_append(&start->queue_link, &queue);
     153#pragma GCC diagnostic pop
    141154
    142155        /* If the symbol is found, it will be stored in 'sym' */
  • uspace/lib/c/test/string.c

    r71b4444 rdd7df1c  
    799799PCUT_TEST(strndup_nonempty_short)
    800800{
     801#pragma GCC diagnostic push
     802        // Intentionally checking it works with _longer_ size than actual
     803#if defined(__GNUC__) && (__GNUC__ >= 11)
     804#pragma GCC diagnostic ignored "-Wstringop-overread"
     805#endif
    801806        char *d = strndup("abc", 5);
     807#pragma GCC diagnostic pop
    802808        PCUT_ASSERT_NOT_NULL(d);
    803809        PCUT_ASSERT_TRUE(d[0] == 'a');
  • uspace/srv/hid/display/test/window.c

    r71b4444 rdd7df1c  
    11091109        PCUT_ASSERT_EQUALS(wnd->display->cursor[dcurs_arrow], wnd->cursor);
    11101110
     1111        // Check that invalid cursors cannot be set: ignore enum conversions
     1112        // as we are out-of-bounds
     1113#pragma GCC diagnostic push
     1114#if defined(__GNUC__) && (__GNUC__ >= 10)
     1115#pragma GCC diagnostic ignored "-Wenum-conversion"
     1116#endif
    11111117        rc = ds_window_set_cursor(wnd, dcurs_limit);
    11121118        PCUT_ASSERT_ERRNO_VAL(EINVAL, rc);
     
    11161122        PCUT_ASSERT_ERRNO_VAL(EINVAL, rc);
    11171123        PCUT_ASSERT_EQUALS(wnd->display->cursor[dcurs_arrow], wnd->cursor);
     1124#pragma GCC diagnostic pop
    11181125
    11191126        rc = ds_window_set_cursor(wnd, dcurs_size_lr);
Note: See TracChangeset for help on using the changeset viewer.