Re: freefunc - name clash with Python.h

2022-04-19 Thread Viktor Dukhovni
> On 21 Jun 2020, at 1:20 pm, Dan Kegel wrote: > > Openssl should probably stop using generic identifiers like freefunc > in its header files, out of sheer self-defense. I'd long held an apparently minority opinion among OpenSSL team members that prototypes in header files MUST NOT name any

Re: freefunc - name clash with Python.h

2020-06-21 Thread Dan Kegel
On Sun, Jun 21, 2020 at 10:13 AM Jordan Brown wrote: > It works out that header files that want to be safe cannot use *any* names > that aren't reserved to them. True that. Openssl should probably stop using generic identifiers like freefunc in its header files, out of sheer self-defense. -

Re: freefunc - name clash with Python.h

2020-06-21 Thread Jordan Brown
On 6/21/2020 7:22 AM, Jakob Bohm via openssl-users wrote: > No sane compiler should complain about name clashes between unrelated > namespaces, such as between global type names and formal parameter names > in header function declarations (used exclusively for readable compiler > error messages

Re: freefunc - name clash with Python.h

2020-06-21 Thread Jakob Bohm via openssl-users
On 2020-06-15 09:37, Viktor Dukhovni wrote: On Mon, Jun 15, 2020 at 06:07:20AM +, Jordan Brown wrote: Supplying names for the arguments in function prototypes makes them easier to read, but risks namespace problems. Yes, which I why, some time back, I argued unsuccessfuly that we SHOULD

Re: freefunc - name clash with Python.h

2020-06-15 Thread Jordan Brown
On 6/15/2020 12:37 AM, Viktor Dukhovni wrote: > OpenSSL SHOULD NOT include parameter names in public headers. It would be sort of, maybe, OK to use names with an appropriate prefix.  That wouldn't be perfect, but it would be better. -- Jordan Brown, Oracle ZFS Storage Appliance, Oracle Solaris

Re: freefunc - name clash with Python.h

2020-06-15 Thread Viktor Dukhovni
On Mon, Jun 15, 2020 at 06:07:20AM +, Jordan Brown wrote: > Supplying names for the arguments in function prototypes makes them > easier to read, but risks namespace problems. Yes, which I why, some time back, I argued unsuccessfuly that we SHOULD NOT use parameter names in public headers in

Re: freefunc - name clash with Python.h

2020-06-15 Thread Jordan Brown
On 6/14/2020 2:54 AM, Dr. Matthias St. Pierre wrote: > I don't see any reason to change our code, IMHO the clash is Python's > fault: it declares a global typedef with a short name that has no > python-specific prefix. That is indeed rude, but the symbol could equally well have been introduced by

RE: freefunc - name clash with Python.h

2020-06-14 Thread Dr. Matthias St. Pierre
> Does my test program do anything interesting on your system? No. Except for compiling with warnings ;-) > Python has: > typedef void (*freefunc)(void *); > > That looks weird to me, but I'm not a language guy. That's simply a C type definition for a pointer type named `freefunc`, which can

Re: freefunc - name clash with Python.h

2020-06-13 Thread Hal Murray
Does my test program do anything interesting on your system? rs...@akamai.com said: > I dlon't lnow about Python's freefunc, no idea what it is, but the OpenSSL > line is defining a function with a local parameter named freefunc. Those > names shouldn't clash; what compiler and flags? Python

Re: freefunc - name clash with Python.h

2020-06-13 Thread Salz, Rich via openssl-users
I dlon't lnow about Python's freefunc, no idea what it is, but the OpenSSL line is defining a function with a local parameter named freefunc. Those names shouldn't clash; what compiler and flags? It should be possible to rename the one in safestack.h to be "freefuncarg" or something. Can you

freefunc - name clash with Python.h

2020-06-13 Thread Hal Murray
I get a blizzard of shadow warnings if Pyhton.h is included along with evp.h. No problems on 1.1.1g from Fedora. They go away if I include evp.h first. /usr/local/ssl/include/openssl/safestack.h:124:72: warning: declaration of ‘freefunc’ shadows a global declaration [-Wshadow] 124 |