Boost.Interprocess file_mapping strange error.

Hi ! I use the Interprocess library version 2006-10-13. I try to test the file_mapping class and I get a really strange error. I use VS 2005 to compile the stuff. This is my short example namespace ip = boost::interprocess; ip::file_mapping mf ("test_file", ip::read_write); So when I debug this code: the debugger enter to the file_mapping constructor, next evaluate the following line: //Check accesses if (mode != read_write || mode != read_only){ error_info err = other_error; throw interprocess_exception(err); } And it throws the error. So I really don't understand why it does it. Thank you. Ce message et toutes les pieces jointes (ci-apres le "message") sont confidentiels et etablis a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite. Tout message electronique est susceptible d'alteration. Societe Generale Asset Management et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie. Decouvrez l'offre et les services de Societe Generale Asset Management sur le site www.sgam.fr ******** This message and any attachments (the "message") are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither Societe Generale Asset Management nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. Find out more about Societe Generale Asset Management's proposal on www.sgam.com

Hi, joel.vennin@sgam.com wrote:
Hi !
I use the Interprocess library version 2006-10-13.
I recommend you downloading the latest code from CVS so that you can get bug-fixes.
[example] So when I debug this code: the debugger enter to the file_mapping constructor, next evaluate the following line:
//Check accesses
if (mode != read_write || mode != read_only){
error_info err = other_error;
throw interprocess_exception(err);
} And it throws the error. So I really don't understand why it does it.
Because the line is not correct. It should be: mode != read_write && mode != read_only This is already fixed in the CVS code, Ion

Are you sure this is not an error: if (mode != read_write || mode != read_only){ mode can only be equal to read_write or to read_only thus is it ALWAYS not equal to the other and this expression will always evaluate to true. Regards, Dennis Bingaman <joel.vennin@sgam.com> Sent by: boost-bounces@lists.boost.org 06/20/2007 09:48 AM Please respond to boost@lists.boost.org To <boost@lists.boost.org> cc Subject [boost] Boost.Interprocess file_mapping strange error. Hi ! I use the Interprocess library version 2006-10-13. I try to test the file_mapping class and I get a really strange error. I use VS 2005 to compile the stuff. This is my short example namespace ip = boost::interprocess; ip::file_mapping mf ("test_file", ip::read_write); So when I debug this code: the debugger enter to the file_mapping constructor, next evaluate the following line: //Check accesses if (mode != read_write || mode != read_only){ error_info err = other_error; throw interprocess_exception(err); } And it throws the error. So I really don't understand why it does it. Thank you. Ce message et toutes les pieces jointes (ci-apres le "message") sont confidentiels et etablis a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite. Tout message electronique est susceptible d'alteration. Societe Generale Asset Management et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie. Decouvrez l'offre et les services de Societe Generale Asset Management sur le site www.sgam.fr ******** This message and any attachments (the "message") are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither Societe Generale Asset Management nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. Find out more about Societe Generale Asset Management's proposal on www.sgam.com _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (3)
-
Dennis D Bingaman
-
Ion Gaztañaga
-
joel.vennin@sgam.com