Heinrich Schuchardt b67267c621 tools/asn1_compiler: avoid -Wdiscarded-qualifiers
Building with GCC 15.2 results in warnings:

    tools/asn1_compiler.c: In function ‘tokenise’:
    tools/asn1_compiler.c:442:37: warning:
    assignment discards ‘const’ qualifier from pointer target type
    [-Wdiscarded-qualifiers]
      442 |             dir = bsearch(&tokens[tix], directives,
          |                 ^

    tools/asn1_compiler.c: In function ‘main’:
    tools/asn1_compiler.c:632:11: warning:
    assignment discards ‘const’ qualifier from pointer target type
    [-Wdiscarded-qualifiers]
      632 |         p = strchr(grammar_name, '.');
          |           ^

bsearch() is defined as

       void *bsearch(size_t n, size_t size;
                     const void key[size], const void base[size * n],
                     size_t n, size_t size,
                     typeof(int (const void [size], const void [size]))
                         *compar);

* Use the correct type for dir.

strchr() is defined as

        char *strchr(const char *s, int c).

* Use a conversion for the assignment to p.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-04-24 11:28:17 -06:00
..
2025-12-10 09:28:43 -06:00
2026-01-02 10:28:14 -06:00
2025-12-10 09:28:43 -06:00
2024-09-12 17:35:37 +02:00
2025-06-03 17:18:02 -06:00
2023-01-27 12:51:26 -05:00
2024-07-15 12:12:18 -06:00
2025-11-10 11:30:56 -06:00
2026-04-06 12:16:57 -06:00
2024-07-15 12:12:18 -06:00
2025-01-26 11:35:46 -06:00
2025-04-11 12:16:44 -06:00