[Top][All Lists]

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

Re: [Bug-apl] SVN 624 Warnings

From: Juergen Sauermann
Subject: Re: [Bug-apl] SVN 624 Warnings
Date: Fri, 08 May 2015 15:27:37 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0


I have rewritten the macro causing this warning, so the warning should disappear. SVN 626.

Elias, emacs mode was affected by this change, so please sync back.

Peter, I would report this as an error to the authors of your compiler. The warning message is
misleading (if it was caused by a too short string as Jay explained) and/or useless.

/// Jürgen

On 05/07/2015 12:49 PM, Elias Mårtenson wrote:
How about rewriting it as &"somestring"[n] instead? That should result in the same code while silencing the compiler warnings.


On 7 May 2015 at 18:27, Juergen Sauermann <address@hidden> wrote:

I believe by string they mean a simple string literal. What I am doing is. for example

"Quad_CT" + 5 (and so on for many ⎕xx functions and variables).

The "Quad_CT" string literal, is, of course, not spelled directly (because then I could have
used "CT" instead) but by macro expansion of #Quad_CT. That is, #Quad_CT is stringified to
to "Quad_CT" which is then offset by 5 to get "CT".

Peter's compiler seems to be a little picky at times.

/// Jürgen

On 05/07/2015 04:52 AM, Elias Mårtenson wrote:
I think the problem here is that std::string doesn't have an overloaded operator that takes an int. Thus, what happens is that the string gets coerced into a char *, which is then offset using the integer.

Thus, if that's what you want you should make it clear using (someString.c_str() + offset). Or if you want to keep an std::string, then someString.substr(offset) should be used.


On 7 May 2015 at 02:07, Juergen Sauermann <address@hidden> wrote:
Hi Peter,

I believe I managed to fix the sem_xxx warnings in SVN 625.

The Postgres warning should remain because it points at a harmless but somewhat incomplete
SQL installation.

The final warning seems to make no sense at all. And yes, adding an int to a string does not append
to the string but skips the beginning. That was the plan.

/// Jürgen

On 05/05/2015 11:37 PM, Peter Teeson wrote:
Hi Jürgen:

/Volumes/Data/Development/MyProjects/GNUAPLWS/apl-svn/src/apl-sqlite.cc:71:3: "PostgreSQL unavailable since ./configure could not detect it."
/Volumes/Data/Development/MyProjects/GNUAPLWS/apl-svn/src/Parallel.cc:62:4: 'sem_init' is deprecated
/Volumes/Data/Development/MyProjects/GNUAPLWS/apl-svn/src/Parallel.cc:134:4: 'sem_getvalue' is deprecated
/Volumes/Data/Development/MyProjects/GNUAPLWS/apl-svn/src/Parallel.cc:150:4: 'sem_init' is deprecated
/Volumes/Data/Development/MyProjects/GNUAPLWS/apl-svn/src/Parallel.cc:151:4: 'sem_init' is deprecated
/Volumes/Data/Development/MyProjects/GNUAPLWS/apl-svn/src/Parallel.cc:386:15: 'sem_getvalue' is deprecated
/Volumes/Data/Development/MyProjects/GNUAPLWS/apl-svn/src/Parallel.cc:391:15: 'sem_getvalue' is deprecated
/Volumes/Data/Development/MyProjects/GNUAPLWS/apl-svn/src/SystemVariable.def:51:1: Adding 'int' to a string does not append to the string



reply via email to

[Prev in Thread] Current Thread [Next in Thread]