Re: C++ reinterpret_cast question

2020-01-30 Thread David Crayford
On 2020-01-30 6:35 AM, Charles Mills wrote: I suppose if someone REALLY wanted to be a C++ pedant, myStruct *opts_char = reinterpret_cast(reinterpret_cast(opts)); haha! that's what I would code but in reality a reinterpret_cast is a raw cast so it doesn't matter. It's a style thing so you

Re: C++ reinterpret_cast question

2020-01-29 Thread Steve Smith
lol. You might be a Programming Geek if "code still works" is a "side benefit". sas On Wed, Jan 29, 2020 at 5:35 PM Charles Mills wrote: > You're a genius! Thanks. Message is gone, and as a side benefit, the code > still works.

Re: C++ reinterpret_cast question

2020-01-29 Thread Charles Mills
y, January 29, 2020 2:36 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: C++ reinterpret_cast question You're a genius! Thanks. Message is gone, and as a side benefit, the code still works. I suppose if someone REALLY wanted to be a C++ pedant, myStruct *opts_char = reinterpret_cast(reinterpret

Re: C++ reinterpret_cast question

2020-01-29 Thread Charles Mills
rles -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Gord Tomlin Sent: Wednesday, January 29, 2020 11:42 AM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: C++ reinterpret_cast question On 2020-01-29 13:29, Charles Mills wrote: > If you're n

Re: C++ reinterpret_cast question

2020-01-29 Thread Charles Mills
MAIN@LISTSERV.UA.EDU] On Behalf Of Allan Kielstra Sent: Wednesday, January 29, 2020 12:27 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: C++ reinterpret_cast question Also, I trust that you know what you're doing! Depending on the implementation of C++, a pointer to a function can sometimes be a po

Re: C++ reinterpret_cast question

2020-01-29 Thread Charles Mills
Hmmm. V2R2 Charles -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Allan Kielstra Sent: Wednesday, January 29, 2020 12:18 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: C++ reinterpret_cast question FWIW, you don't get this warning

Re: C++ reinterpret_cast question

2020-01-29 Thread Allan Kielstra
Also, I trust that you know what you're doing! Depending on the implementation of C++, a pointer to a function can sometimes be a pointer to a function descriptor. So be careful with what you do with opts_char. (But you say that the resulting code basically works so that is good.) Also, on

Re: C++ reinterpret_cast question

2020-01-29 Thread Allan Kielstra
FWIW, you don't get this warning with 2.4.1 (or 2.3.1). What version are you using? -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Re: C++ reinterpret_cast question

2020-01-29 Thread Joseph Reichman
Microsoft Visual C has #pragma warning (disable : ) dint know about XL C > On Jan 29, 2020, at 1:29 PM, Charles Mills wrote: > > If you're not a C++ person you may hit Delete at any time ... > > I want to load a module that is a non-executable table (and non-reentrant) > and then

Re: C++ reinterpret_cast question

2020-01-29 Thread Gord Tomlin
On 2020-01-29 13:29, Charles Mills wrote: If you're not a C++ person you may hit Delete at any time ... I want to load a module that is a non-executable table (and non-reentrant) and then modify it. I have the entry point declared as extern "OS" typedef int compiler_t(void *parm1); compiler_t

C++ reinterpret_cast question

2020-01-29 Thread Charles Mills
If you're not a C++ person you may hit Delete at any time ... I want to load a module that is a non-executable table (and non-reentrant) and then modify it. I have the entry point declared as extern "OS" typedef int compiler_t(void *parm1); compiler_t *opts; (compiler_t is what is expected by