[FFmpeg-devel] [PATCH] avfilter/formats: fix wrong function name in error message
Michael Niedermayer
michael at niedermayer.cc
Tue Dec 12 19:12:50 EET 2017
On Tue, Dec 12, 2017 at 01:59:18PM +0800, Jun Zhao wrote:
>
>
> On 2017/12/7 8:49, Jun Zhao wrote:
> >
> > On 2017/12/5 17:25, Hendrik Leppkes wrote:
> >> On Tue, Dec 5, 2017 at 6:42 AM, Jun Zhao <mypopydev at gmail.com> wrote:
> >>> On 2017/12/5 2:32, Michael Niedermayer wrote:
> >>>> On Mon, Dec 04, 2017 at 11:07:11AM +0100, Hendrik Leppkes wrote:
> >>>>> On Mon, Dec 4, 2017 at 10:53 AM, Moritz Barsnick <barsnick at gmx.net> wrote:
> >>>>>> On Mon, Dec 04, 2017 at 13:02:20 +0800, Jun Zhao wrote:
> >>>>>>> Use perdefined micro __FUNCTION__ rather than hard coding function name
> >>>>>>> to fix wrong function name in error message.
> >>>>>> AFAICT, "__FUNCTION__" is a C99 feature and thereby not supported by
> >>>>>> ffmpeg style. Or should it be? (It might be "supported by all compilers
> >>>>>> we care about".)
> >>>>>>
> >>>>>> http://ffmpeg.org/developer.html#C-language-features
> >>>>>>
> >>>>> __FUNCTION__ is not C99, its a compiler extension (which is understood
> >>>>> by GCC and some other compilers). __func__ is the C99 keyword.
> >>>>> Its likely that not all compilers we currently support would have
> >>>>> __func__, if they all have __FUNCTION__ however I cannot tell.
> >>>> There are some matches for __FUNCTION__ in git, so i wonder if all
> >>>> compilers we support do support it
> >>> So now we have 2 option:
> >>>
> >>> 1). Find a ways to get the current function on different platforms in
> >>> C90,
> >>> https://stackoverflow.com/questions/7008485/func-or-function-or-manual-const-char-id
> >>> have some information for this way. (lot of #if defined )
> >>> 2). Just remove __FUNCTION__ from the code. Total 5 __FUNCTION__ in
> >>> source code when grep the code.
> >>>
> >>> Personally, I prefer option 2 than option 1, any comments?
> >> If __FUNCTION__ is already in use right now (and hence supported by
> >> all compilers we have), it should be fine to use it again, so no need
> >> for complex ifdefs, I would think.
> >> In fact I just checked, and its in use in a key part in avformat, not
> >> even an optional module, so any compiler not supporting it would
> >> already fail building it now.
> >>
> >> - Hendrik
> > I agree, so we need to wait more comments for this ?
>
> Any comments, Michael ? or we need to remove all __FUNCTION__ from the
> code ?
ill apply the patch as it seems all concerns have been resolved IIUC
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Never trust a computer, one day, it may think you are the virus. -- Compn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171212/f8b1f466/attachment.sig>
More information about the ffmpeg-devel
mailing list