Re: Safe conversion TQString to char* in TQt3

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

 



Hi,

the purpose of the change is not to prevent bugs that programmers can do 
but to give the same scope for results from utf8() and local8Bit() as is 
for results from latin1() and ascii().

At the same time, the goal was to make the change so that there is no 
change in the public API.

The proposed change covers exactly these requirements. Nothing more, 
nothing less.

Cheers
-- 
Slávek

On Sunday 03 of February 2019 16:48:43 Fat-Zer wrote:
> Hello to everybody,
>
> I'm not a fan of solutions that just mask issues rather really fix
> things. And IMHO this approach only relaxes coders and makes them fall
> for other pitfalls. e.g. next code still remains broken:
>
>     const char * myData;
>     {
>       TQString str = someString();
>       myData = str.utf8()
>     }
>
> IMHO the better way would be to make the API stricter. E.g. remove
> (hide by macro) operator const char *() for TQCString, It will reveal
> most of potentially erroneous uses like described.
>
> Just my 2 cents.
>
> вс, 3 февр. 2019 г. в 14:55, Slávek Banko <slavek.banko@xxxxxxx>:
> > Hello to all programmers,
> >
> > please give your attention and share your opinion to the proposed
> > patch for TQt3. For a detailed description of the problem, see the
> > pull-request:
> >
> > https://mirror.git.trinitydesktop.org/gitea/TDE/tqt3/pulls/6
> >
> > Cheers
> > --
> > Slávek

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Trinity Users]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [KDE]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]     [Trinity Desktop Environment]

  Powered by Linux