Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BOM_codes initializer #151

Merged
merged 1 commit into from Mar 13, 2024
Merged

Fix BOM_codes initializer #151

merged 1 commit into from Mar 13, 2024

Conversation

fweimer-rh
Copy link
Contributor

Future compilers will reject the current initializer:

io.c:1002:7: error: initialization of ‘char’ from ‘void *’ makes integer from pointer without a cast
 1002 |     { NULL, 0, NULL },
      |       ^~~~
io.c:1002:16: error: initialization of ‘char’ from ‘void *’ makes integer from pointer without a cast
 1002 |     { NULL, 0, NULL },
      |                ^~~~
io.c:996:26: warning: missing braces around initializer [-Wmissing-braces]
  996 | static BOM BOM_codes[] = {
      |                          ^
io.c:996:26: warning: missing braces around initializer [-Wmissing-braces]

The reason is that NULL is usually a pointer constant, which is not a valid expression for a character.

Related to:

Future compilers will reject the current initializer:

io.c:1002:7: error: initialization of ‘char’ from ‘void *’ makes integer from pointer without a cast
 1002 |     { NULL, 0, NULL },
      |       ^~~~
io.c:1002:16: error: initialization of ‘char’ from ‘void *’ makes integer from pointer without a cast
 1002 |     { NULL, 0, NULL },
      |                ^~~~
io.c:996:26: warning: missing braces around initializer [-Wmissing-braces]
  996 | static BOM BOM_codes[] = {
      |                          ^
io.c:996:26: warning: missing braces around initializer [-Wmissing-braces]


The reason is that NULL is usually a pointer constant, which is not
a valid expression for a character.
@ttti07
Copy link

ttti07 commented Mar 13, 2024

I also suffer from the same compilation errors, with clang compiler in Apple M1 CPU...
And I agree that this is the right solution.

@mhulden mhulden merged commit e0d8122 into mhulden:master Mar 13, 2024
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.

None yet

3 participants