https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66214

--- Comment #27 from Guille <guille at cal dot berkeley.edu> ---
(In reply to Guille from comment #26)
> In the case below (fails to compile ssl.h on OSX 10.9.5), 
>  I could simply go to ssl.h lines 337 and 339 and comment out the
>  'DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER'.. 
> then it compiled no problem. 

I tested that again. Ignore the above comment. 
One can make it compile as follows.
This is the *original* relevant part of ssl.h:
330: struct bn_gencb_st
     {
      unsigned int ver;   /* To handle binary (in)compatibility */
      void *arg;      /* callback-specific data */
      union
335:      {
          /* if(ver==1) - handles old style callbacks */
          void (*cb_1)(int, int, void *)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
          /* if(ver==2) - new callback style */
          int (*cb_2)(int, int, BN_GENCB *)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
340:      } cb;
      };

take the union outside the struct and give it a name: 

   union bn_gencb_st__cb_t
   {
      void (*cb_1)(int, int, void *)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
      int (*cb_2)(int, int, BN_GENCB *)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
   };
   struct bn_gencb_st
   {
      unsigned int ver;
      void *arg;
      bn_gencb_st__cb_t cb;
   };

then it compiles fine. 

> 
> 
> (In reply to Guille from comment #24)
> > Yes, just checked that. 
> > 'gcc -g file_that_include_ssl_h.cpp' builds fine, but 
> > 'g++ -g file_that_include_ssl_h.cpp' ICEs. 
> > 
> > 
> > (In reply to Magnus Fromreide from comment #23)
> > > One more question - you are using the command
> > > 
> > > g++ -g file_that_include_ssl_h.cpp
> > > 
> > > right? Building it as C works for me as well.

Reply via email to