[liblouis-liblouisxml] Re: [liblouis] r1162 committed - Fix a warning

  • From: Christian Egli <christian.egli@xxxxxx>
  • To: michael.whapples@xxxxxxxxxxxx
  • Date: Tue, 06 May 2014 18:03:17 +0200

"Michael Whapples" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender
"mwhapples@xxxxxxx" for DMARC) writes:

> The reason for copy is that lou_logPrint takes char * where as that
> function has message defined as const char *. 

Ah, ok that explains it.

> It is wrong to cast from const char * to char *. 

I agree.

> If lou_logPrint does not modify format then I could have changed
> lou_logPrint to take const char * but John Boyer has been reluctant
> for API changes.

Can't we just do that. That seems like the best solution and we are
changing the api anyway (migrate from logprint to the logging callback),
so I don't see a problem in changing this.

> If people are willing for lou_logPrint to change to taking const char
> * then I will change that.

Yes, please do.

> Why not use strdup? Wasn't fully sure of the status of it in Visual
> Studio. When checking MSDN it says that strdup is depricated and to
> use _strdup instead. I don't know whether GCC supports _strdup and did
> not want conditional compilation. Advise which out of strdup and
> _strdup I should use and I will change to it.

Ah, I didn't know that strdup was a problem in Visual Studio. Bert has
been using it in his table resolver. I would suggest that you just use
it and then I'll include the gnulib module for strdup which provides
its own implementation if the platform doesn't have it, so we should be
on the safe side.

Thanks
Christian

-- 
Christian Egli
Swiss Library for the Blind, Visually Impaired and Print Disabled
Grubenstrasse 12, CH-8045 Zürich, Switzerland

-----
Tag der offenen Tuer.
Die SBS laedt Sie herzlich ein: 28. Juni 2014 von 9 bis 16 Uhr.
Mehr Informationen erhalten Sie unter http://www.sbs.ch/offenetuer
For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts: