GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Embed Notice

HTML Code

Corresponding Notice

  1. Embed this notice
    Kees Cook :tux: (kees@fosstodon.org)'s status on Monday, 16-Dec-2024 16:24:48 JSTKees Cook :tux:Kees Cook :tux:

    Dear C Lazy Web,

    How do I define an array of nonstring char arrays?

    just a char array, valid:
    char str[4] __attribute__((nonstring)):

    array of char arrays, cursed:
    char multi[10][4] __attribute__((nonstring));

    I've tried typedefs and moving the attribute around. No luck. What am I missing?

    Here's a godbolt:
    https://godbolt.org/z/4Mb61heG1
    I'd want to see a warning for both strlen() instances...

    In conversationabout 5 months ago from fosstodon.orgpermalink

    Attachments

    1. Domain not in remote thumbnail source whitelist: raw.githubusercontent.com
      Compiler Explorer - C (x86-64 gcc (trunk))
      from Matt Godbolt
      struct foo { char str[8] __attribute__((nonstring)); char multi[3][8] __attribute__((nonstring)); int a; }; int len(struct foo *p) { return strlen(p->str) + strlen(p->multi[2]); }
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.