New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API doc for SvUTF8 #7687
Comments
From perl-5.8.0@ton.iguana.beCreated by perl-5.8.0@ton.iguana.beThe doc for SvUTF8 says: SvUTF8 Returns a boolean indicating whether the SV contains UTF-8 bool SvUTF8(SV* sv) The code however does: #define SvUTF8(sv) (SvFLAGS(sv) & SVf_UTF8) which results in an U32 That is of course no problem in constructs like: if (SvUTF8(sv)) { ... } but if you do: bool utf8 = SvUTF8(sv); things fail badly because (at least on my system) the bool enum becomes a Either the docs or the macro should be updated I think Several other things that are called "bool" in the api doc have the same Perl Info
|
From @nwc10On Mon, Dec 06, 2004 at 02:25:52AM -0000, perl-5. 8. 0 @ ton. iguana. be wrote:
I think that the docs should be updated, given that people write code using <hate>Yes, I've been bitten by this stupidity of "BOOL" while tweaking the Nicholas Clark |
The RT System itself - Status changed from 'new' to 'open' |
From @smpeters
Acutally, everything looking a return value from SvFLAGS(sv) should be Inline Patch--- sv.h.old Sat Sep 10 20:30:54 2005
+++ sv.h Sat Sep 10 20:30:47 2005
@@ -703,8 +703,8 @@
SvFLAGS(sv) |= (SVf_NOK|SVp_NOK))
/*
-=for apidoc Am|bool|SvUTF8|SV* sv
-Returns a boolean indicating whether the SV contains UTF-8 encoded data.
+=for apidoc Am|U32l|SvUTF8|SV* sv
+Returns a U32 value indicating whether the SV contains UTF-8 encoded data.
=for apidoc Am|void|SvUTF8_on|SV *sv
Turn on the UTF-8 status of an SV (the data is not changed, just the flag).
There will probably need to be some changes in the core as well where
any of Sv*OK-like macros are on the right side of an assignment. |
From @rgsSteve Peters via RT wrote:
Fine, but probably all other docs for SvFLAGS bit tests need the same
|
From @smpetersOn Mon, Sep 12, 2005 at 12:41:23PM +0200, Rafael Garcia-Suarez wrote:
Yes, they do. They have nearly identical API doc listings, though, so |
From @rgsFixed by change #29718. |
@rgs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#32884 (status was 'resolved')
Searchable as RT32884$
The text was updated successfully, but these errors were encountered: