Skip to content

Conversation

@firewave
Copy link
Contributor

@firewave firewave commented Nov 3, 2025

No description provided.

Example:
```
fontutils/fv1.c:36:1: error: ‘static’ is not at beginning of declaration [-Werror=old-style-declaration]
   36 | const static char FV1_SIGNATURE[] = {'F', 'N', 'T', '1'};
      | ^~~~~
```
```
/home/user/CLionProjects/xrdp/common/list.c: In function ‘list_create_sized’:
/home/user/CLionProjects/xrdp/common/list.c:50:41: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
   50 |     self = (struct list *)calloc(sizeof(struct list), 1);
      |                                         ^~~~~~
/home/user/CLionProjects/xrdp/common/list.c:50:41: note: earlier argument should specify number of elements, later size of each element
```
xrdp uses C zero initializers quite a bit. If '-Wextra' is specified,
these generate compiler warnings. This command adds two macros
ALLOW_ZERO_INITIALIZER_BEGIN and ALLOW_ZERO_INITIALIZER_BEGIN which
allow the compiler warnings to be silenced with zero initializers.
Fixes a gcc compiler warning regarding a potentially unportable
use of 'defined()' in a macro
@matt335672
Copy link
Member

@firewave - I've taken the liberty of adding a couple of commits to your PR.

  1. We use C zero initializers quite a bit in xrdp. These are well-defined, but obviously fail foul of -Wmissing-field-initializers. I've added a workaround for this. Let me know what you think.
  2. The other warning related to a macro definition is pretty straightforward.

@firewave
Copy link
Contributor Author

firewave commented Nov 4, 2025

  1. We use C zero initializers quite a bit in xrdp. These are well-defined, but obviously fail foul of -Wmissing-field-initializers. I've added a workaround for this. Let me know what you think.

If you are fine with adding annotations so am I. I would have just disabled the warnings as to keep the code clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants