[Boost-bugs] [Boost C++ Libraries] #5725: Different ordering of includes can lead to compilation errors ( ‘SEEK_SET’ cannot appear in a constant-expression etc )

Subject: [Boost-bugs] [Boost C++ Libraries] #5725: Different ordering of includes can lead to compilation errors ( ‘SEEK_SET’ cannot appear in a constant-expression etc )
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-07-20 15:08:26


#5725: Different ordering of includes can lead to compilation errors ( ‘SEEK_SET’
cannot appear in a constant-expression etc )
------------------------------------------------------------------------------------+
 Reporter: Relja Arandjelovic <arandjelovic.relja@…> | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: interprocess
  Version: Boost 1.46.1 | Severity: Problem
 Keywords: SEEK_SET, include ordering, compilation error, interprocess, mpi, asio |
------------------------------------------------------------------------------------+
 Hi,

 I've got a problem with compiling an extremely simple program on one
 machine while there is no problem on another one. The program is:

 {{{
 #include <boost/asio.hpp>
 #include <boost/mpi.hpp>
 #include <boost/interprocess/sync/interprocess_semaphore.hpp>
 int main(){ return 0; }
 }}}


 I get these errors:

 {{{
 /usr/local/include/boost/interprocess/detail/os_file_functions.hpp:363:33:
 error: ‘SEEK_SET’ cannot appear in a constant-expression
 /usr/local/include/boost/interprocess/detail/os_file_functions.hpp:364:33:
 error: ‘SEEK_END’ cannot appear in a constant-expression
 /usr/local/include/boost/interprocess/detail/os_file_functions.hpp:365:33:
 error: ‘SEEK_CUR’ cannot appear in a constant-expression
 }}}

 Only this order of includes causes the problem, changing the order makes
 compilation complete successfully and the program (along with a more
 complicated one) runs fine.

 The error happens on my Ubuntu 11.04 (natty), kernel: 2.6.38-8-generic,
 gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2 .
 It doesn't happen on my other machine with the same version of boost and
 any ordering of the includes, it runs Ubuntu 10.04.2 LTS (lucid), kernel:
 2.6.32-30-generic, with gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3 .

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5725>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC