Hi everyone, I’m working with the LLVM C API now. I see that several functions are deprecated, however the only notion is in comments around the function. Is there any specific reason why __attribute__((deprecated)) is omitted? Will it make sense to send a patch with such additions? -- AlexDenisov Software Engineer, http://lowlevelbits.org -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 496 bytes Desc: Message signed with OpenPGP using GPGMail URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160405/34923286/attachment.sig>
James Y Knight via llvm-dev
2016-Apr-05 21:09 UTC
[llvm-dev] [llvm-c] Deprecated functions
I think there's a two different "levels" of deprecated: a) There's a better function you should know about and prefer in new code, but the old one will (probably) not be removed. This sort of deprecation should only be mentioned in comments, since there's no real reason to have people's builds start spewing warning messages if they used the old function. b) There's a better function, and the old one will be removed soon. These ought to use a deprecated attribute, in order to entice people to switch over before it turns into a "no such function" error. I'd expect most of the deprecations in the C API to be of the former kind. On Tue, Apr 5, 2016 at 4:07 PM, Alex Denisov via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi everyone, > > I’m working with the LLVM C API now. > I see that several functions are deprecated, however the only notion is in > comments around the function. > > Is there any specific reason why __attribute__((deprecated)) is omitted? > Will it make sense to send a patch with such additions? > -- > AlexDenisov > Software Engineer, http://lowlevelbits.org > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160405/79e5edf1/attachment.html>
> On Apr 5, 2016, at 2:09 PM, James Y Knight via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > I think there's a two different "levels" of deprecated: > a) There's a better function you should know about and prefer in new code, but the old one will (probably) not be removed.Well, I’m not sure: if I’m doing some cleanup, and I reach the C API, I’ll look when the function was deprecated and may decide to remove it if it was not in the last release. — Mehdi> This sort of deprecation should only be mentioned in comments, since there's no real reason to have people's builds start spewing warning messages if they used the old function. > b) There's a better function, and the old one will be removed soon. These ought to use a deprecated attribute, in order to entice people to switch over before it turns into a "no such function" error. > > I'd expect most of the deprecations in the C API to be of the former kind. > > On Tue, Apr 5, 2016 at 4:07 PM, Alex Denisov via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: > Hi everyone, > > I’m working with the LLVM C API now. > I see that several functions are deprecated, however the only notion is in comments around the function. > > Is there any specific reason why __attribute__((deprecated)) is omitted? > Will it make sense to send a patch with such additions? > -- > AlexDenisov > Software Engineer, http://lowlevelbits.org <http://lowlevelbits.org/> > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev> > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160405/b7b1d4e5/attachment.html>
Eric Christopher via llvm-dev
2016-Apr-05 22:18 UTC
[llvm-dev] [llvm-c] Deprecated functions
Yeah, honestly they're more the latter, but we haven't generally used the attribute here. Mostly because we'd get to conditionalize another attribute. I don't have a strong opinion either way though. (i.e. feel free to submit something that adds an attribute for all platforms, or not if this is a good enough explanation). -eric On Tue, Apr 5, 2016 at 2:09 PM James Y Knight via llvm-dev < llvm-dev at lists.llvm.org> wrote:> I think there's a two different "levels" of deprecated: > a) There's a better function you should know about and prefer in new code, > but the old one will (probably) not be removed. This sort of deprecation > should only be mentioned in comments, since there's no real reason to have > people's builds start spewing warning messages if they used the old > function. > b) There's a better function, and the old one will be removed soon. These > ought to use a deprecated attribute, in order to entice people to switch > over before it turns into a "no such function" error. > > I'd expect most of the deprecations in the C API to be of the former kind. > > On Tue, Apr 5, 2016 at 4:07 PM, Alex Denisov via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> Hi everyone, >> >> I’m working with the LLVM C API now. >> I see that several functions are deprecated, however the only notion is >> in comments around the function. >> >> Is there any specific reason why __attribute__((deprecated)) is omitted? >> Will it make sense to send a patch with such additions? >> -- >> AlexDenisov >> Software Engineer, http://lowlevelbits.org >> >> >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> >> > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160405/8ac8d4cc/attachment.html>