Menu

#2318 strdup not declared in c99

closed-fixed
None
sdld
5
2014-12-30
2014-11-23
No

Since the sdld linker is built with --std=c99 gcc no longer knows about strdup() and generates lots of warnings.

I suggest everyone to build sdcc with make > /dev/null so you actually get to see all warnings and fix them before doing a commit.

Discussion

  • Erik Petrich

    Erik Petrich - 2014-11-26

    On derna, the --std=c99 option seems to cause the mingw32 build to completely fail because _MAX_FNAME and _splitpath() become missing and they are needed in sdld.c

    Is the only reason for --std=c99 to fix the problem with a duplicate definition of strndup()? If so, we could update configure.in to check for an existing system definition and bracket the local definition with #ifndef HAVE_STRNDUP rather than change the dialect.

     
  • Maarten Brock

    Maarten Brock - 2014-12-30
    • status: open --> closed-fixed
    • assigned_to: Erik Petrich
     
  • Maarten Brock

    Maarten Brock - 2014-12-30

    Fixed in SDCC 3.4.1 #9119.

     
  • Maarten Brock

    Maarten Brock - 2014-12-30
    • status: closed-fixed --> open
     
  • Maarten Brock

    Maarten Brock - 2014-12-30

    Oops, I think I closed this too early. The latest solution breaks the MSVC build because it has no sdccconf.h.

     
  • Maarten Brock

    Maarten Brock - 2014-12-30

    Fixed in #9153.

     
  • Maarten Brock

    Maarten Brock - 2014-12-30
    • status: open --> closed-fixed
     

Log in to post a comment.