<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem with strpbrk in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/problem-with-strpbrk/m-p/5056768#M93841</link>
    <description>Hello Clay,&lt;BR /&gt;&lt;BR /&gt;Yes both strings are NULL terminated.  It is single threaded and the debugger shows the strings clean going in.  Both strings are const.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Fred</description>
    <pubDate>Thu, 05 Jul 2007 18:11:29 GMT</pubDate>
    <dc:creator>Fred Vogel</dc:creator>
    <dc:date>2007-07-05T18:11:29Z</dc:date>
    <item>
      <title>Problem with strpbrk</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-strpbrk/m-p/5056766#M93839</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'm having difficulty with strpbrk going into a recursive loop that explodes the stack.  This is happened when I use my c++ compiler and not my c compiler.  The application i'm building right now has be be built in c++.  &lt;BR /&gt;&lt;BR /&gt;I'm on an HP11.23v2 IA machine.  32 bit compiles. aCC A.06.13.  For the life of me I cannot figure out why this is happening but know the problem has to be really easy and something i'm missing.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Fred</description>
      <pubDate>Thu, 05 Jul 2007 17:14:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-strpbrk/m-p/5056766#M93839</guid>
      <dc:creator>Fred Vogel</dc:creator>
      <dc:date>2007-07-05T17:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with strpbrk</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-strpbrk/m-p/5056767#M93840</link>
      <description>Without seeing your code it's a bit difficult to comment. I assume that both strings are actually NUL terminated and have not been stepped on by other code. I would output the string values just before the call to strpbrk. Note that this functions expects both of the strings to be const. Is this a multi-threaded program so that the strings might be being altered by another thread?</description>
      <pubDate>Thu, 05 Jul 2007 17:25:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-strpbrk/m-p/5056767#M93840</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-07-05T17:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with strpbrk</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-strpbrk/m-p/5056768#M93841</link>
      <description>Hello Clay,&lt;BR /&gt;&lt;BR /&gt;Yes both strings are NULL terminated.  It is single threaded and the debugger shows the strings clean going in.  Both strings are const.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Fred</description>
      <pubDate>Thu, 05 Jul 2007 18:11:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-strpbrk/m-p/5056768#M93841</guid>
      <dc:creator>Fred Vogel</dc:creator>
      <dc:date>2007-07-05T18:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with strpbrk</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-strpbrk/m-p/5056769#M93842</link>
      <description>Can you grep for strpbrk in /opt/aCC/include_std/*?&lt;BR /&gt;&lt;BR /&gt;There are 3 or 4 C string functions that are required to be overloaded by the C++ Standard.  It looks like strpbrk is one of them because of the broken C definition.&lt;BR /&gt;&lt;BR /&gt;I would not expect them to fail unless you illegally had a macro like:&lt;BR /&gt;#define const&lt;BR /&gt;Or used the old cfront trick of -Dconst=.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Clay: Note that this function expects both of the strings to be const.&lt;BR /&gt;&lt;BR /&gt;That's not what "const" means.  It means that the function doesn't modify them, so it allows const strings.  And due to qualification conversion, a char* can be passed to a const char*.</description>
      <pubDate>Fri, 06 Jul 2007 04:06:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-strpbrk/m-p/5056769#M93842</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-07-06T04:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with strpbrk</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-strpbrk/m-p/5056770#M93843</link>
      <description>Hi Dennis,&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;Can you grep for strpbrk /opt/aCC/include_std/*?&lt;BR /&gt;&lt;BR /&gt;Yes, I have been stareing at it for a day now, particularly in cstring.  I ran the grep you asked, here is what it spit out:&lt;BR /&gt;&lt;BR /&gt;cstring:#define strpbrk __strpbrk_keep_out&lt;BR /&gt;cstring:#undef strpbrk&lt;BR /&gt;cstring:#pragma builtin strpbrk&lt;BR /&gt;cstring:#pragma extern strchr, strpbrk, strrchr, strstr, memchr&lt;BR /&gt;cstring:    extern "C" const char* strpbrk(const char *, const char *);&lt;BR /&gt;cstring:    inline char* strpbrk(char *s, const char *p);&lt;BR /&gt;cstring:        return const_cast&lt;CHAR&gt; (strpbrk(const_cast&lt;CONST char=""&gt;(s), p));&lt;BR /&gt;cstring:using ::strpbrk;&lt;BR /&gt;string.h:using std::strpbrk;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;I would not expect them to fail unless you illegally had a macro like:&lt;BR /&gt;&amp;gt;&amp;gt;#define const&lt;BR /&gt;&amp;gt;&amp;gt;Or used the old cfront trick of -Dconst=.&lt;BR /&gt;&lt;BR /&gt;I did find a #define const behind a #ifndef __STDC__ definition.  I was worried that it might get picked up since i'm using the ++ compiler, so I deleted it.  I rebuilt everything from scratch, same problem.&lt;BR /&gt;&lt;BR /&gt;Is there any tusc or elfdump information that I could provide that would help?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Fred&lt;/CONST&gt;&lt;/CHAR&gt;</description>
      <pubDate>Fri, 06 Jul 2007 11:05:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-strpbrk/m-p/5056770#M93843</guid>
      <dc:creator>Fred Vogel</dc:creator>
      <dc:date>2007-07-06T11:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with strpbrk</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-strpbrk/m-p/5056771#M93844</link>
      <description>I have realized that i am having the same problem with strchr, which is guess is no big surprise.&lt;BR /&gt;&lt;BR /&gt;Here are some things I think may be important.  The code with strpbrk and strchr is in an archive library that was compiled in ansi c.  The running program was compiled in c++ and linked with this .a file.  I went ahead an made an all c++ version and still no joy.&lt;BR /&gt;&lt;BR /&gt;Fred</description>
      <pubDate>Fri, 06 Jul 2007 13:10:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-strpbrk/m-p/5056771#M93844</guid>
      <dc:creator>Fred Vogel</dc:creator>
      <dc:date>2007-07-06T13:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with strpbrk</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-strpbrk/m-p/5056772#M93845</link>
      <description>Dennis,&lt;BR /&gt;&lt;BR /&gt;You hit the nail on the head.  I did remove the offending #define const and kept having the problem.  Turns out that the #define const was being autogenerated.  Once I got rid of that...it worked like a charm!&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Fred</description>
      <pubDate>Fri, 06 Jul 2007 17:41:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-strpbrk/m-p/5056772#M93845</guid>
      <dc:creator>Fred Vogel</dc:creator>
      <dc:date>2007-07-06T17:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with strpbrk</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-strpbrk/m-p/5056773#M93846</link>
      <description>&amp;gt;I did find a #define const behind a #ifndef __STDC__ definition.&lt;BR /&gt;&lt;BR /&gt;So the proper test would be to use:&lt;BR /&gt;#if !defined(__STDC__) &amp;amp;&amp;amp; !defined(__cplusplus)</description>
      <pubDate>Fri, 06 Jul 2007 21:42:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-strpbrk/m-p/5056773#M93846</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-07-06T21:42:11Z</dc:date>
    </item>
  </channel>
</rss>

