-
Notifications
You must be signed in to change notification settings - Fork 171
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
BUG: Use C99 flexible arrays instead of type[1] trailing member #77
Comments
Flamefire
added a commit
to Flamefire/libsamplerate
that referenced
this issue
Jul 29, 2019
Flamefire
added a commit
to Flamefire/libsamplerate
that referenced
this issue
Jul 29, 2019
Already required for configure builds, now also for CMake builds. Simplifies some code as e.g. lrint and stdint.h are always available. Closes libsndfile#77
This was referenced Jul 29, 2019
Merged
Flamefire
added a commit
to Flamefire/libsamplerate
that referenced
this issue
Jul 29, 2019
Already required for configure builds, now also for CMake builds. Simplifies some code as e.g. lrint and stdint.h are always available. Closes libsndfile#77
erikd
pushed a commit
that referenced
this issue
Jul 29, 2019
Flamefire
added a commit
to Flamefire/libsamplerate
that referenced
this issue
Aug 9, 2019
Already required for configure builds, now also for CMake builds. Simplifies some code as e.g. lrint and stdint.h are always available. Closes libsndfile#77
erikd
pushed a commit
that referenced
this issue
Aug 10, 2019
Already required for configure builds, now also for CMake builds. Simplifies some code as e.g. lrint and stdint.h are always available. Closes #77
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related to #68 as it requires C99 (although C99 features are already used)
C99 flexible arrays are used at some points, e.g.: https://github.com/erikd/libsamplerate/blob/2647fd9bac5f11f24b5f1ee55806671f81520f66/src/src_sinc.c#L57
At other the idiom of having a trailing
float[1]
member is used: https://github.com/erikd/libsamplerate/blob/2647fd9bac5f11f24b5f1ee55806671f81520f66/src/src_linear.c#L34A SO answer highly recommends using the C99 feature: https://stackoverflow.com/a/247040/1930508 with a comment that using
float[1]
may produce incorrect code: https://lkml.org/lkml/2015/2/18/407Furthermore to much memory is allocated (1 additional float): https://github.com/erikd/libsamplerate/blob/2647fd9bac5f11f24b5f1ee55806671f81520f66/src/src_linear.c#L174
Bottom line:
float[1]
The text was updated successfully, but these errors were encountered: