Re: many packages __FUNCTION__ problems



I don't think it is appropriate to put this type of dependencies throughout
GNOME. If people use G_STRLOC, then they will get FILE:LINE for non-GCC
or GCC >= 3.0, once we deal with the problem in GLib; if they use
G_GNUC_FUNCTION or G_GNUC_PRETTY_FUNCTION they will get "". 

See:

  http://bugzilla.gnome.org/show_bug.cgi?id=69097

For the central location for tracking this issue.

For Glib-2.2 we'll probably have a new #define which is __func__ or
__PRETTY_FUNCTION__ depending on the compiler and cannot be concatenated.

Regards,
                                        Owen

Ali Akcaagac <ali akcaagac stud fh-wilhelmshaven de> writes:

> hello,
> 
> oki as manny of you know development goes on, so is gcc 3.0.3 going on
> and a lot of gnome related packages unfortunately causes an error
> when used with -Werror on __FUNCTION__ since it is marked as depracted
> in gcc 3.0.3 because of c99. also the glib solution is no real solution.
> to make sure that people with most recent compiler can use your package
> and for the sake of future consistence look at this patch that i applied
> here.
> 
> what does this patch do:
> 
> a) it adds some sumbroutines to configure.in which checks in this row:
> 
>    do we have funct (yes/no)
>      if yes, export variable
>      if no
>        do we have pretty function (yes/no)
>          if yes, export variable
>          if no
>            do we have function (yes/no)
>              if yes, export variable
>              if no (should'nt happen)
> 
> b) adds the declaraions to acconfig.h
> c) your_source_that_contains_function.c
> 
>    added three different ifdefs so we always get the right code.
> 
> i added pretty_function because i belive that pretty function outputs
> more information than function. i know that on other unix systems a lot
> of compilers doesn't support __FUNCTION__ but __func__ so if this works
> then i bet you can offer your packages to a more wide userbase.
> 
> you need less than 5 minutes to figure out what my patch does and how to
> apply it to your own package. by doing this you make sure that a lot of
> people won't get any errors.
> 
> i welcome comments, suggestions, corrections and feedback. i may also be
> wrong with this (i doubt it). but it's worth to pay attention to this
> and take care to solve this issue correctly.
> 
> attached example is done for gdm2 cvs (gnome1) and should only be an
> example. i already send some patches to some other project but since
> they are too many of them, so i can't handle all patches on my own.



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