doyubkim / fluid-engine-dev

Fluid simulation engine for computer graphics applications
https://fluidenginedevelopment.org/
MIT License
1.88k stars 263 forks source link

Compile error when compiling with Clang 10 #304

Closed ceeac closed 4 years ago

ceeac commented 4 years ago

Compiling with Clang 10 yields the following error:

fluid-engine-dev/src/examples/hello_fluid_sim/main.cpp:22:59: error: 'sizeof (kGrayScaleTable)' will return the size of the pointer, not the array itself [-Werror,-Wsizeof-pointer-div]
const size_t kGrayScaleTableSize = sizeof(kGrayScaleTable)/sizeof(char);
                                   ~~~~~~~~~~~~~~~~~~~~~~~^
fluid-engine-dev/src/examples/hello_fluid_sim/main.cpp:21:13: note: pointer 'kGrayScaleTable' declared here
const char* kGrayScaleTable = " .:-=+*#%@";

Clang version:

$ clang --version
clang version 10.0.0-4ubuntu1 
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
doyubkim commented 4 years ago

Thanks for reporting this! Let me fix the issue.