Re: V7R3 C++ questions
"Qian Ren" <[email protected]>
| Newsgroups | gmane.comp.lang.as400.c |
|---|---|
| Message-ID | <OFDA853FA5.DA195AF7-ON002580BF.002C4A2F-482580BF.002E6561@notes.na.collabserv.com> |
Thanks Aaron for helping with these questions. Hi Kelly, Here are some answers to your questions. - We started to support a subset of C++11 features in ILE C++ compiler in V7R2 release. And in V7R3 release, there were some new C++11 features added. The supported feature list is in the 'What's new' page in 'ILE C/C+ + Language Reference' document. Please see below. All the supported features will be enabled when LANGLVL(*EXTENDED0X) option is specified. V7R2 link " http://www.ibm.com/support/knowledgecenter/ssw_ibm_i_72/rzarg/rzarg09.htm" V7R3 link " http://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rzarg/rzarg09.htm" - For ixlc interface, option '-qlanglvl=extended0x' should be used. Please note that there is NO asterisk '*' in the front of 'extended0x'. This is equivalent to CL command option LANGLVL(*EXTENDED0X). Following link shows the mappings of CL command compiler options to their ixlc equivalents. " http://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rzarf/qshell_compiler_options.htm " - For macro '__C99_FUNC__', this is an document error. The macro name should be '__C99__FUNC__'. There should be two underscores '__' between '__C99' and 'FUNC__'. We will update the document on knowledge center to correct this error. - Macro '__IBMCPP_NULLPTR' and '__IBMCPP_CONSTEXPR' work for me. Could you please check if you have PTF SI61190 installed on your system? Most of new C++11 features are enabled by this PTF on V7R3 release. Thank you. Qian Ren (Jarod) From: "Aaron Albertson" <albertaa-r/[email protected]> To: "Bare Metal Programming IBM i \(AS/400 and iSeries\)" <c400-l-Zwy7GipZuJhWk0Htik3J/[email protected]> Date: 02/04/2017 07:48 AM Subject: Re: [C400-L] V7R3 C++ questions Sent by: "C400-L" <c400-l-bounces-Zwy7GipZuJhWk0Htik3J/[email protected]> Hi Kelly, That looks like a bug. I tried it myself and got the same results. I believe that the primary compiler representative that would watch this forum is on vacation right now, but I will forward a description of this discussion chain to the team so that they are aware of the problem. Hopefully when they get back they can comment on the issue. If this is an urgent problem I would recommend contacting IBM support and they can probably find somebody to look at the issue more quickly. Thanks, Aaron Albertson "C400-L" <c400-l-bounces-Zwy7GipZuJhWk0Htik3J/[email protected]> wrote on 02/03/2017 04:21:34 PM: > From: Kelly Beard <[email protected]> > To: "Bare Metal Programming IBM i (AS/400 and iSeries)" <c400-l-Zwy7GipZuJhWk0Htik3J/[email protected]> > Date: 02/03/2017 04:22 PM > Subject: Re: [C400-L] V7R3 C++ questions > Sent by: "C400-L" <c400-l-bounces-Zwy7GipZuJhWk0Htik3J/[email protected]> > > Sorry, but I cannot drop the issues I'm having with the V7R3 C++ compiler. > > On our new system, ixlc points to this > > /bin/ixlc -> /qsys.lib/qdevtools.lib/qczcxlc.pgm > > Everytime I run it, a QPRINT spool file gets created which contains the > following, which I assume is debug statements: > > Bytes_Return = 35 > Bytes_Avail = 35 > Libs_In_Syslibl = 0 > Prod_Libs = 0 > Curr_Libs = 0 > Libs_In_Usrlibl = 0 > Lib_Name = 'BEAK ' > > That's it. I also can't use the compile option "-qlanglvl=..." like the > following: > > ixlc -+ QUSRJOBI_0400.cpp -omother -qprint -prtmsgid -qlanglvl=*extended0x > INVALID COMPILING OPTIONS:-qlanglvl=*extended0x > > This, however, works fine > > CRTBNDCPP PGM(BEAK/MOTHER) > SRCSTMF('/home/beak/QUSRJOBI_0400.cpp') > OUTPUT(*print) > LANGLVL(*EXTENDED0X) > TGTRLS(V7R3M0) > > If I am reading the V7R3 C++ reference manual correctly, I should be > getting more print statements out than I am. This program code > > #include <iostream> > #include <string> > #include <sstream> > #include <iomanip> > #include <unistd.h> > using namespace std; > > void function() > { > cout << __FUNCTION__ << ": I will do nothing sir, and like it!" << endl; > } > > > int main(int argc, char* argv[]) > { > #if defined(__C99_FUNC__) > cout << "__C99_FUNC__ yes" << endl; > #endif > cout << __IBMCPP__ << endl; > #if defined(__IBMCPP_NULLPTR) > cout << "__IBMCPP_NULLPTR yes" << endl; > #endif > #if defined(__IBMCPP_CONSTEXPR) > cout << "__IBMCPP_CONSTEXPR yes" << endl; > #endif > cout << __C99_MAX_LINE_NUMBER << endl; > cout << __FUNCTION__ << endl; > function(); > } > > Doesn't print anything in regards to __C99_FUNC__, __IBMCPP_NULLPTR or > __IBMCPP_CONSTEXPR. I thought that they should if the *EXTENDED0X option > is specified. > > > On Fri, Feb 3, 2017 at 2:09 PM, Justin Taylor <[email protected]> wrote: > > > Thanks > > > > -----Original Message----- > > From: Aaron Albertson [mailto:albertaa-r/[email protected]] > > Sent: Friday, February 03, 2017 12:50 PM > > To: Bare Metal Programming IBM i (AS/400 and iSeries) <c400-l-Zwy7GipZuJhWk0Htik3J/[email protected] > > > > > Subject: Re: [C400-L] V7R3 C++ questions > > > > > > Hi Justin, > > > > My apologies for misremembering the original question. I looked > > at the 7.1 version of the supported language extensions, and as you said, > > C++ > > 11 does not appear in that list. That means that either C++ 11 is > > entirely unsupported or only a small subset of C++ 11 features are > > supported. You can assume that any set of compiler features that does not > > appear in the list is either not supported or only partially supported. > > > > IBM i 7.1 GA'ed in 2010, prior to the ratification of C++ 11 in > > 2011. > > There might be some limited subset of the functionality in the compiler, > > implemented with the assumption that they would become part of the standard > > when it was ratified. If there is a particular function that you are > > interested in you should try it to see if it is part of the compiler. > > > > Thanks, > > > > Aaron Albertson > > > > > > > > -- > > This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) > > mailing list > > To post a message email: C400-L-Zwy7GipZuJhWk0Htik3J/[email protected] > > To subscribe, unsubscribe, or change list options, > > visit: http://lists.midrange.com/mailman/listinfo/c400-l > > or email: C400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected] > > Before posting, please take a moment to review the archives > > at http://archive.midrange.com/c400-l. > > > > > > > -- > Kelly Beard > -- > This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400- > L) mailing list > To post a message email: C400-L-Zwy7GipZuJhWk0Htik3J/[email protected] > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/c400-l > or email: C400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected] > Before posting, please take a moment to review the archives > at http://archive.midrange.com/c400-l. > -- This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list To post a message email: C400-L-Zwy7GipZuJhWk0Htik3J/[email protected] To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/c400-l or email: C400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected] Before posting, please take a moment to review the archives at http://archive.midrange.com/c400-l. -- This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list To post a message email: C400-L-Zwy7GipZuJhWk0Htik3J/[email protected] To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/c400-l or email: C400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected] Before posting, please take a moment to review the archives at http://archive.midrange.com/c400-l.