Opened 20 months ago
Closed 20 months ago
#14701 closed enhancement (fixed)
Fix atomic_lib compiler warnings
Reported by: | Tom Goddard | Owned by: | pett |
---|---|---|---|
Priority: | moderate | Milestone: | |
Component: | Core | Version: | |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Notify when closed: | Platform: | all | |
Project: | ChimeraX |
Description
I get various compiler warning compiling atomic_lib on Mac ARM (XCode version 15.1). Would be nice to clean up the code so it does not give these warnings, so real problems will be more apparent.
$ cd bundles/src/atomic_lib
$ make install
PYTHONNOUSERSITE=1 /Users/goddard/ucsf/chimerax/ChimeraX.app/Contents/bin/python3.11 -I -m chimerax.core --nogui --exit --safemode --cmd "devel install . user false exit true noDeps true"
Executing: devel install . user false exit true noDeps true
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: archive library: src/lib/libatomstruct_tmpl.a will be fat and ar(1) will not be able to operate on it
atomic_cpp/atomstruct_cpp/Structure.cpp:66:21: warning: field 'ss_ids_normalized' will be initialized after field
'_worm_ribbon' [-Wreorder-ctor]
pdb_version(0), ss_ids_normalized(false), _worm_ribbon(false)
~~
lower_case_chains(false) pdb_version(0) ss_ids_normalized(false)
atomic_cpp/atomstruct_cpp/Structure.cpp:867:5: warning: loop will run at most once (loop increment never executed)
[-Wunreachable-code-loop-increment]
for (auto a: r->atoms())
atomic_cpp/atomstruct_cpp/Structure.cpp:1092:27: warning: add explicit braces to avoid dangling else [-Wdangling-else]
} else if (a1_last && a2_first) {
3 warnings generated.
atomic_cpp/atomstruct_cpp/Structure.cpp:66:21: warning: field 'ss_ids_normalized' will be initialized after field
'_worm_ribbon' [-Wreorder-ctor]
pdb_version(0), ss_ids_normalized(false), _worm_ribbon(false)
~~
lower_case_chains(false) pdb_version(0) ss_ids_normalized(false)
atomic_cpp/atomstruct_cpp/Structure.cpp:867:5: warning: loop will run at most once (loop increment never executed)
[-Wunreachable-code-loop-increment]
for (auto a: r->atoms())
atomic_cpp/atomstruct_cpp/Structure.cpp:1092:27: warning: add explicit braces to avoid dangling else [-Wdangling-else]
} else if (a1_last && a2_first) {
3 warnings generated.
atomic_cpp/atomstruct_cpp/seq_assoc.cpp:453:24: warning: comparison of integers of different signs: 'int' and
'size_type' (aka 'unsigned long') [-Wsign-compare]
if (mseq_index >= num_mseq_res)
1 warning generated.
atomic_cpp/atomstruct_cpp/seq_assoc.cpp:453:24: warning: comparison of integers of different signs: 'int' and
'size_type' (aka 'unsigned long') [-Wsign-compare]
if (mseq_index >= num_mseq_res)
1 warning generated.
Changed code and added compiler flags to eliminate the warnings.