public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ilja.j.honkonen at nasa dot gov" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/61259] Spurious "ISO C++ forbids zero-size array" warning with -pedantic
Date: Wed, 21 Oct 2015 21:38:00 -0000	[thread overview]
Message-ID: <bug-61259-4-YsyFUu1NXY@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61259-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61259

ilja.j.honkonen at nasa dot gov changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ilja.j.honkonen at nasa dot gov

--- Comment #2 from ilja.j.honkonen at nasa dot gov ---
I'm seeing this also, when I create an ofstream with () instead of {} I get a
complaint from gcc-4.4 to gcc-5:

#include "vector"
#include "string"
#include "fstream"
#include "boost/filesystem.hpp"
int main() {
        std::vector<std::string> input_files{"a.out"};
        std::ofstream str(
        //std::ofstream str{
                boost::filesystem::path(input_files[0])
                        .parent_path()
                        .append("b")
                        .generic_string()
        );
        //};
}

g++-mp-4.9 gcc.cpp -I $HOME/include -L $HOME/lib -lboost_filesystem
-lboost_system -std=c++0x -W -Wall -Wextra -pedantic -O3
gcc.cpp: In function 'int main()':
gcc.cpp:9:41: warning: ISO C++ forbids zero-size array 'input_files'
[-Wpedantic]
   boost::filesystem::path(input_files[0])
                                         ^

g++-mp-4.4 gcc.cpp -I $HOME/include -L $HOME/lib -lboost_filesystem
-lboost_system -std=c++0x -W -Wall -Wextra -pedantic -O3
gcc.cpp: In function 'int main()':
gcc.cpp:9: warning: ISO C++ forbids zero-size array 'input_files'


  parent reply	other threads:[~2015-10-21 21:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-20 18:40 [Bug c++/61259] New: " bugs at qult dot net
2014-05-20 19:01 ` [Bug c++/61259] " redi at gcc dot gnu.org
2015-10-21 21:38 ` ilja.j.honkonen at nasa dot gov [this message]
2021-04-20  7:57 ` [Bug c++/61259] [Regression 8/9/10/11] " reichelt at gcc dot gnu.org
2021-04-30  9:19 ` [Bug c++/61259] [8/9/10/11/12 Regression] " rguenth at gcc dot gnu.org
2021-05-14  9:47 ` [Bug c++/61259] [9/10/11/12 " jakub at gcc dot gnu.org
2021-06-01  8:06 ` rguenth at gcc dot gnu.org
2022-05-27  9:35 ` [Bug c++/61259] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:30 ` jakub at gcc dot gnu.org
2023-07-07 10:30 ` [Bug c++/61259] [11/12/13/14 " rguenth at gcc dot gnu.org
2024-02-20  8:55 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-61259-4-YsyFUu1NXY@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).