gms-bbg / gamess-issues

GAMESS issue tracking
7 stars 1 forks source link

Possible coding error in ddi/src/ddi_signals.c #5

Closed behlingstephen closed 5 years ago

behlingstephen commented 5 years ago

I was alerted to a probable coding error in gamess/ddi/src/ddi_signals.c by the Clang compiler. This was my first attempt to compile the C-language parts of GAMESS with Clang.

A Clang warning suggested Line 147 was wrong. Here are lines 146 and 147 of the ddi_signals.c source file:

/ Clean up semaphores associated with shared-memory segments / while(smp_data = (SMP_Data *) SMP_find_end()) {

I think that should be:

while(smp_data == (SMP_Data *) SMP_find_end()) {

The compiler is an internal Cray Clang C-language compiler based on LLVM 8.0.0svn. It seems to have newer and different language parser that allowed it notice this issue.

Make sure these boxes are checked before submitting your issue - thank you!

keipertk commented 5 years ago

The while loop is checking for the implicit condition smp_data != NULL

To suppress the error, you could change the line to while((smp_data=(SMP_Data *) SMP_find_end()) != NULL)