From jeroen.vrijnsen at philips.com Thu Jan 18 01:08:20 2018 From: jeroen.vrijnsen at philips.com (Vrijnsen, Jeroen) Date: Thu Jan 18 01:09:05 2018 Subject: [xsde-users] Disabling warnings from generated code Message-ID: Hi, We're currently using xsde-3.3.0.a8, cxx-hybrid. I have an issue regarding compiler warnings being reported: we compile our code with GCC 4.8.5, additional (interesting) options 'std=c++11 -Wall -Wextra -Wshadow'. The code that is being generated results in many compiler warnings (on -Wshadow), mainly on the generated pimpl and pskel codes. As I'm not interested in those warnings, I would like to disable warnings for these generated files. Looking into the cxx-hybrid help, I seem to have the following options to achieve this: either (1) use '--prologue-file ' and '--epilogue-file ', to add a list of '#pragma ignore ' statements, or (2) use the '--disable-warning ' option. Experimenting with both options, I bump into issues: (1) The prologue/epilogue file is added to the .cxx/hxx files, but not to the '-pimpl' and '-pskel' files. (2) I'm not sure what to put for : -Wshadow, shadow, quotes needed? I somewhere found a statement that 'all' should disable all warnings Anyhow, none of the before achieve the desired result. So the question remains: how can I disable warnings for _all_ generated code, so including the pskel and pimpl files? Kind regards, Jeroen Vrijnsen ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From boris at codesynthesis.com Thu Jan 18 06:10:40 2018 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jan 18 06:11:16 2018 Subject: [xsde-users] Disabling warnings from generated code In-Reply-To: References: Message-ID: Vrijnsen, Jeroen writes: > Looking into the cxx-hybrid help, I seem to have the following options > to achieve this: either > > (1) use '--prologue-file ' and '--epilogue-file ', > to add a list of '#pragma ignore ' statements, or Yes, this is the way to do it. > (2) use the '--disable-warning ' option. No, this options suppresses XSD/e compiler's own warnings, not warnings to be issued by the C++ compiler. > (1) The prologue/epilogue file is added to the .cxx/hxx > files, but not to the '-pimpl' and '-pskel' files. >From the man page: --hxx-prologue text Insert text at the beginning of the header file. For the C++/Hybrid mapping, the text argument can be optionally prefixed with a file key in the form key=text. The valid values for key are pskel (parser skeleton files), pimpl (parser implementation files), sskel (serializer skeleton files), simpl (serializer implementation files), and * (all files). If key is empty or not present then the text is used for the object model files only. Boris From jeroen.vrijnsen at philips.com Thu Jan 18 08:33:03 2018 From: jeroen.vrijnsen at philips.com (Vrijnsen, Jeroen) Date: Thu Jan 18 08:34:48 2018 Subject: [xsde-users] Disabling warnings from generated code In-Reply-To: References: , Message-ID: Hi Boris, Thanks for the quick reply. I don't know what man-page you refer to, I looked at the 'xsde help cxx-hybrid' information. That does not list the 'key=*' option; it might be worthwhile to add this information. When I know attempt to run with '--prologue-file key=* /prologue.txt', I get the error "prologue.txt:1:1: error: invalid document structure". The content of my prologue file (there is also a corresponding epilogue file): #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wshadow" What format should the file adhere to? Regards, Jeroen ________________________________ From: Boris Kolpackov Sent: Thursday, January 18, 2018 12:10:40 PM To: Vrijnsen, Jeroen Cc: xsde-users@codesynthesis.com Subject: Re: [xsde-users] Disabling warnings from generated code Vrijnsen, Jeroen writes: > Looking into the cxx-hybrid help, I seem to have the following options > to achieve this: either > > (1) use '--prologue-file ' and '--epilogue-file ', > to add a list of '#pragma ignore ' statements, or Yes, this is the way to do it. > (2) use the '--disable-warning ' option. No, this options suppresses XSD/e compiler's own warnings, not warnings to be issued by the C++ compiler. > (1) The prologue/epilogue file is added to the .cxx/hxx > files, but not to the '-pimpl' and '-pskel' files. >From the man page: --hxx-prologue text Insert text at the beginning of the header file. For the C++/Hybrid mapping, the text argument can be optionally prefixed with a file key in the form key=text. The valid values for key are pskel (parser skeleton files), pimpl (parser implementation files), sskel (serializer skeleton files), simpl (serializer implementation files), and * (all files). If key is empty or not present then the text is used for the object model files only. Boris ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From jeroen.vrijnsen at philips.com Thu Jan 18 08:44:36 2018 From: jeroen.vrijnsen at philips.com (Vrijnsen, Jeroen) Date: Thu Jan 18 08:45:20 2018 Subject: [xsde-users] Disabling warnings from generated code In-Reply-To: References: , , Message-ID: Hi Boris, Already found my mistake, I should have used '--prologue-file *=/prologue.txt'. All works fine now! Kind regards, Jeroen ________________________________ From: Vrijnsen, Jeroen Sent: Thursday, January 18, 2018 2:33:03 PM To: xsde-users@codesynthesis.com Subject: Re: [xsde-users] Disabling warnings from generated code Hi Boris, Thanks for the quick reply. I don't know what man-page you refer to, I looked at the 'xsde help cxx-hybrid' information. That does not list the 'key=*' option; it might be worthwhile to add this information. When I know attempt to run with '--prologue-file key=* /prologue.txt', I get the error "prologue.txt:1:1: error: invalid document structure". The content of my prologue file (there is also a corresponding epilogue file): #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wshadow" What format should the file adhere to? Regards, Jeroen ________________________________ From: Boris Kolpackov Sent: Thursday, January 18, 2018 12:10:40 PM To: Vrijnsen, Jeroen Cc: xsde-users@codesynthesis.com Subject: Re: [xsde-users] Disabling warnings from generated code Vrijnsen, Jeroen writes: > Looking into the cxx-hybrid help, I seem to have the following options > to achieve this: either > > (1) use '--prologue-file ' and '--epilogue-file ', > to add a list of '#pragma ignore ' statements, or Yes, this is the way to do it. > (2) use the '--disable-warning ' option. No, this options suppresses XSD/e compiler's own warnings, not warnings to be issued by the C++ compiler. > (1) The prologue/epilogue file is added to the .cxx/hxx > files, but not to the '-pimpl' and '-pskel' files. >From the man page: --hxx-prologue text Insert text at the beginning of the header file. For the C++/Hybrid mapping, the text argument can be optionally prefixed with a file key in the form key=text. The valid values for key are pskel (parser skeleton files), pimpl (parser implementation files), sskel (serializer skeleton files), simpl (serializer implementation files), and * (all files). If key is empty or not present then the text is used for the object model files only. Boris ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.