Skip to content

Problem printing boost::gregorian::date #2

@jartu

Description

@jartu

Hi,

TL;DR: executing print day in gdb where day is a boost::gregorian::date(2021, 12, 31) yields a completely different date being printed: "2021-03-00".

Configuration:

  • OS: Debian GNU/Linux 9.13 (stretch)
  • Boost version: Boost-1.71.0
  • g++ version: 9.4.0
  • gdb version: 10.1.90.20210103-git
  • cmake version: 3.20.0

Program:

#include <iostream>
#include <boost/date_time.hpp>
int main() {
    const boost::gregorian::date day(2021, 12, 31);
    std::cerr << day << std::endl;
}

Running the program in gdb, stopping at the std::cerr line and executing print day gives me:

(gdb) print day
$1 = (boost::gregorian::date) 2021-03-00

The expectation is that it prints: 2021-12-31

Thanks
Jaroslav

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions