electro-smith / DaisySP

A Powerful DSP Library in C++
https://www.electro-smith.com/daisy
Other
882 stars 139 forks source link

String.h breaking compilation after directory refactoring #137

Closed antisvin closed 3 years ago

antisvin commented 3 years ago

New directory structure requires listing all folders with -I parameter to gcc. As a result, string.h ends up shadowing system header when something like #include <string.h> is used in third party code

It was not an issue previously, as only top level directory was added to include list.

antisvin commented 3 years ago

Managed to solve this by using "-idirafter" instead of "-I" for including DaisySP directories in custom makefile used to build it. Feel free to close this issue, unless someone decides that this header needs a better name.

zeroisnan commented 3 years ago

I came here to report the same issue, I worked around using -iquote (see gcc manuale here).

Regardless of the specific gcc option used, I believe this is an issue that should be addressed at the library level (by renaming the file) rather than in the build system, as you do have control over the code, while have no control on how users will integrate the library in their projects.

stephenhensley commented 3 years ago

Ha, wow. Somehow three of us looked at that module name and didn't think, "That's going to cause problems down the road".

I'd even just be open to changing the name to avoid a clash with the keyword in general.

stephenhensley commented 3 years ago

I'll have a PR in a few minutes, and have renamed the filename to KarplusString.h instead to make it a bit clearer what it is, and to avoid the name conflict.