You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In OTP-26 compilation of a NIF that includes <erl_nif.h> produces a warning:
$ cc -g -O3 -ansi -pedantic -Wall -Wextra -I../ -I ~/.asdf/installs/erlang/26.0/erts-14.0/include -fPIC -shared -o test.so test.c
In file included from test.c:4:
~/.asdf/installs/erlang/26.0/erts-14.0/include/erl_nif.h:192:21: warning: comma at end of enumerator list [-Wpedantic]
192 | ERL_NIF_UTF8 = 2,
| ^
While the enum syntax permits the comma at the end of the last enum value, apparently the recent C compiler still emits the warning
File: erl_nif.h
typedefenum
{
ERL_NIF_LATIN1=1,
ERL_NIF_UTF8=2, // <--- here
}ErlNifCharEncoding;
The text was updated successfully, but these errors were encountered:
That's due to your -ansi flag (and being pedantic about that), not compilers in general.
Trailing comma was added in C99.
However; since C++ was slower at adding it (C++11?) it would make sense to not have it unless you already have somewhat high minimum C/C++ versions already elsewhere.
Describe the bug
In OTP-26 compilation of a NIF that includes
<erl_nif.h>
produces a warning:While the enum syntax permits the comma at the end of the last enum value, apparently the recent C compiler still emits the warning
File: erl_nif.h
The text was updated successfully, but these errors were encountered: