Menu

#251 sgml2pl parser compile error

Other
open
nobody
None
5
2021-11-15
2021-11-15
No

When trying to run code that uses the sgml2pl module on MacOS X, I get an error trying to compile the module due to a call to strdup on line 5232 of the file: packages/sgml/cc/parser.c. I believe this has to do with C99 compliance since strdup is a POSIX function.

Adding the following line after the #include directives solves the problem for me, although I haven't tested it in other OSes:

extern char strdup(const char);

Let me know if I can provide further feedback.

Related

Bugs: #251

Discussion

  • Tuncay Tekle

    Tuncay Tekle - 2021-11-15

    I realized after posting that asterisks lead to style and I am unable to edit, the code I actually added is as follows:

    extern char* strdup(const char*);
    
     
  • David S. Warren

    David S. Warren - 2021-11-15

    Hi Tuncay,
    Thanks for the fix. It breaks the windows compile, since it seems windows has strdup as a macro.
    I tried compiling on linux, but couldn't figure out how to compile it. The makefile in sgml package doesn't seem to work for me. So, anyway, I've conditioned your change using our DARWIN flag (the flag for MACOS).
    Thanks!

     
    • Michael Kifer

      Michael Kifer - 2021-11-15
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <style id="user-content-bidiui-paragraph-margins" type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>


      on linux and on mac it compiles when you do

      [sgml].



      --

             --- michael


       


      On 11/15/21 10:20 AM, David S. Warren wrote:
      Hi Tuncay,
      Thanks for the fix.  It breaks the windows compile, since it seems windows has strdup as a macro.
      I tried compiling on linux, but couldn't figure out how to compile it.  The makefile in sgml package doesn't seem to work for me.  So, anyway, I've conditioned your change using our DARWIN flag (the flag for MACOS).  
      Thanks!
      
      
      ---
      
      ** [bugs:#251] sgml2pl parser compile error**
      
      **Status:** open
      **Group:** Other
      **Created:** Mon Nov 15, 2021 01:35 PM UTC by Tuncay Tekle
      **Last Updated:** Mon Nov 15, 2021 01:37 PM UTC
      **Owner:** nobody
      
      
      When trying to run code that uses the sgml2pl module on MacOS X, I get an error trying to compile the module due to a call to strdup on line 5232 of the file: packages/sgml/cc/parser.c. I believe this has to do with C99 compliance since strdup is a POSIX function. 
      
      Adding the following line after the #include directives solves the problem for me, although I haven't tested it in other OSes:
      
      extern char* strdup(const char*);
      
      Let me know if I can provide further feedback.
      
      
      
      ---
      
      Sent from sourceforge.net because you indicated interest in <https://sourceforge.net/p/xsb/bugs/251/>
      
      
      
      To unsubscribe from further messages, please visit <https://sourceforge.net/auth/subscriptions/>
      
       

      Related

      Bugs: #251


Log in to post a comment.

MongoDB Logo MongoDB