C++ ansi/pedantic problem




The gtk-- project is having a problem with one of the declarations
in the gtk+ headers.  Apparently, a compiler switch for checking
for ansi violations in C++ code is also changing the nature of some 
of the declarations.  

  typedef void (*GtkSignalFunc) ();

     ==  void (*)(void)   default
     ==  void (*)(...)    -ansi -pedantic

This means that if unless the gtk+ library and the applications
are compiled with the same switchs there is linker errors for
C++ programs.  (A demo of how this is a problem is attached.)

The solution is to fix the declaration of GtkSignalFunc to 
the desired meaning when working with C++ compilers.

Replacing the declaration with 

  #ifdef __cplusplus
  typedef void (*GtkSignalFunc) (void);
  #else
  typedef void (*GtkSignalFunc) ();
  #endif

and in item factory change from 
  typedef void    (*GtkItemFactoryCallback)  ();
to
  typedef GtkSignalFunc GtkItemFactoryCallback;

should solve the problem. 

Thanks.

--Karl

---------------------------------------------------------------
begin 664 pedantic.tar.gz
M'XL(`-$7:#@``^V62X_:,!#'N:X_Q8B]0'@Y(2'2$O52J3WUTAYZ1)9QP"78
M*#&K5A7?O9/PR':7+;T$^IB?"#9F;(\R_L]XH^;"."U'K>;@/.1Q'&'+_3CB
M3]LC+1[S<<#]<<S]%C9\$K0@:M"G$]O"B1R@M5)&984UK]E=^O\O97.,_P>Q
M4JG.5`-[<)_SR21\-?Y!')SB/_;1S@^C@+>`-^#+"_[S^#.190_@5.$8<_[0
M8M\?2@ENN(3CD6!WLM>#P6<TA8$PA8;!\=C`0.XGX.R@FAW\<K;<&Z`U[ECM
M9<L1>S"RE2=/AIG,E#`/["Y?P^!C"M[0'IQEMWYS_P8G_5=1;&:/B_HO<_Y>
M_T$<5?D_YC'I_QJP>VUDMITK2+0M7*[$^DT]UD8AMQE[M'H.TAJCI.MHXT#W
MX;U;?=(+([)W6R,A[4,Y_J7+`+[C`VB^=9`DT#[.:R=)IUS(ZZ9)HLP\FZ+=
MCF1\6VK]#Y=-[7%)_^,H/M7_25CI/^)CTO\U8",/W%(74'X,=A4LW*H'2R7F
M*@=OA,D@G:L49C.YR;9%^3#UU:G<0/MM&\5^CUK6*5;T;WB6T+!*%AWOI_S0
MA8I.=\K.K;<[+8+>%':MT".S@$*O=8;!$9N-$GGEG]WFF%DP,Z%C!R_.)*?G
MN6F?FJ9T:7A)K?_@9O7?#\/Z_E_VL?[[$>G_&IRO]:FUG:J4[_"+E?)9"VTJ
M=8E\(?L@E_C2/*_\];BO^8>BOY>AW\<5^D&72OR?3JW_\;`A^5_4/Y_4]_\)
M#ZKZ'Y+^K\)9^>,-8%:F@&=UM%OF@UL[3!`$01`$01`$01`$01#$;_,#N;LV
%.P`H````
`
end



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]