Skip to Content.
Sympa Menu

charm - [charm] compiler warning when pupping vector of bool

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

[charm] compiler warning when pupping vector of bool


Chronological Thread 
  • From: Robert Steinke <rsteinke AT uwyo.edu>
  • To: Charm Mailing List <charm AT cs.illinois.edu>
  • Subject: [charm] compiler warning when pupping vector of bool
  • Date: Tue, 19 Jul 2016 15:42:04 -0600
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=rsteinke AT uwyo.edu;
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:99

I get a compiler warning "taking address of temporary" when I pup a std::vector<bool>. There is no warning when I pup std::vector<int>. I am using charm version 6.6.1 and gcc. I haven't gotten a chance to test it on the latest version of charm, but there is a simple minimal case that produces the warning so I thought I would pass it along quickly.


Compile this code:


#include <charm++.h>

void my_pup(PUP::er &p)
{
std::vector<int> justFine;
std::vector<bool> troubleMaker;

p | justFine;
p | troubleMaker;
}



Get this warning:


In file included from /opt/build/charm/bin/../include/sdag.h:27,
from /opt/build/charm/bin/../include/CkMarshall.decl.h:6,
from /opt/build/charm/bin/../include/charm++.h:134,
from deleteme.cpp:1:
/opt/build/charm/bin/../include/pup_stl.h: In function ‘void PUP::PUP_stl_container_items(PUP::er&, container&) [with container = std::vector<bool, std::allocator<bool> >, dtype = bool]’:
/opt/build/charm/bin/../include/pup_stl.h:156: instantiated from ‘void PUP::PUP_stl_container(PUP::er&, container&) [with container = std::vector<bool, std::allocator<bool> >, dtype = bool]’
/opt/build/charm/bin/../include/pup_stl.h:179: instantiated from ‘void PUP::operator|(PUP::er&, std::vector<T, std::allocator<_Tp1> >&) [with T = bool]’
deleteme.cpp:9: instantiated from here
/opt/build/charm/bin/../include/pup_stl.h:138: warning: taking address of temporary




Archive powered by MHonArc 2.6.16.

Top of Page