Skip to content

Conversation

@sjaenick
Copy link
Contributor

$ g++ --version
g++ (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[ 25%] Building CXX object CMakeFiles/salib.dir/src/aln.cpp.o
In file included from /home/sj/strobealign/src/aln.hpp:10,
                 from /home/sj/strobealign/src/aln.cpp:1:
/home/sj/strobealign/src/sam.hpp: In function ‘Alignment {anonymous}::extend_seed(const Aligner&, const Nam&, const References&, const Read&, bool)’:
/home/sj/strobealign/src/sam.hpp:12:8: error: ‘alignment.Alignment::ref_id’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   12 | struct Alignment {
      |        ^~~~~~~~~
/home/sj/strobealign/src/aln.cpp:255:23: note: ‘alignment.Alignment::ref_id’ was declared here
  255 |             Alignment alignment;
      |                       ^~~~~~~~~
In file included from /home/sj/strobealign/src/aln.hpp:10,
                 from /home/sj/strobealign/src/aln.cpp:1:
/home/sj/strobealign/src/sam.hpp:12:8: error: ‘alignment.Alignment::global_ed’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   12 | struct Alignment {
      |        ^~~~~~~~~
/home/sj/strobealign/src/aln.cpp:255:23: note: ‘alignment.Alignment::global_ed’ was declared here
  255 |             Alignment alignment;
      |                       ^~~~~~~~~
In file included from /home/sj/strobealign/src/aln.hpp:10,
                 from /home/sj/strobealign/src/aln.cpp:1:
/home/sj/strobealign/src/sam.hpp:12:8: error: ‘alignment.Alignment::length’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   12 | struct Alignment {
      |        ^~~~~~~~~
/home/sj/strobealign/src/aln.cpp:255:23: note: ‘alignment.Alignment::length’ was declared here
  255 |             Alignment alignment;
      |                       ^~~~~~~~~
In file included from /home/sj/strobealign/src/aln.hpp:10,
                 from /home/sj/strobealign/src/aln.cpp:1:
/home/sj/strobealign/src/sam.hpp:12:8: error: ‘alignment.Alignment::is_revcomp’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   12 | struct Alignment {
      |        ^~~~~~~~~
/home/sj/strobealign/src/aln.cpp:255:23: note: ‘alignment.Alignment::is_revcomp’ was declared here
  255 |             Alignment alignment;
      |                       ^~~~~~~~~
cc1plus: some warnings being treated as errors
make[2]: *** [CMakeFiles/salib.dir/build.make:167: CMakeFiles/salib.dir/src/aln.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:157: CMakeFiles/salib.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

@marcelm
Copy link
Collaborator

marcelm commented May 21, 2025

Thanks! Very strange that g++ 12, which I’m using, doesn’t show the error. Also interesting to see that the results change very slightly (only for paired-end reads), so it would appear that we were actually using the uninitialized values somehow. I’m not sure how, but I think Sam::add_pair would be the place to look for if we want to know exactly.

Note I’m merging this manually because I needed to change your commit message and I failed to push to your branch (apparently because it’s also named main).

marcelm added a commit that referenced this pull request May 21, 2025
@sjaenick sjaenick closed this May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants