Skip to content

Compiler warning -Wsizeof-array-div #709

@heitbaum

Description

@heitbaum
[31/41] Building C object src/cecc-client/CMakeFiles/cecc-client.dir/cecc-client.c.o
../src/cecc-client/cecc-client.c: In function 'main':
../src/cecc-client/cecc-client.c:502:88: warning: expression does not compute the number of elements in this array; element type is 'cec_adapter', not 'cec_adapter[10]' [-Wsizeof-array-div]
  502 |     iDevicesFound = g_iface.find_adapters(g_iface.connection, devices, sizeof(devices) / sizeof(devices), NULL);
      |                                                                                        ^
../src/cecc-client/cecc-client.c:502:88: note: add parentheses around the second 'sizeof' to silence this warning
../src/cecc-client/cecc-client.c:497:17: note: array 'devices' declared here
  497 |     cec_adapter devices[10];
      |                 ^~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions