Menu

CodeGit Merge Request #9: fix for bug 149 - Build in cygwin error: '::asprintf' has not been declared (rejected)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

dinostray wants to merge 1 commit from /u/dinostray/log4cpp/ to master, 2026-03-24

Commit Date  
[096c2c] (HEADmaster) by dinostray dinostray

fix for bug 149 - Build in cygwin error: '::asprintf' has not been declared

2017-10-08 18:21:36 Tree

Discussion

  • Alexander Perepelkin

    Hello @dinostray,

    Running the compilation with this change will cause the following warning issued for every source file when built on Ubuntu:

    ../include/log4cpp/threading/PThreads.hh:12: warning: "_GNU_SOURCE" redefined
    

    And that will introduce a lot of new warnings into compilation

    In details:

    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../include -I../include -Wall -Wno-unused -pedantic -MT AppenderSkeleton.lo -MD -MP -MF .deps/AppenderSkeleton.Tpo -c AppenderSkeleton.cpp  -fPIC -DPIC -o .libs/AppenderSkeleton.o
    In file included from ../include/log4cpp/threading/Threading.hh:30,
                     from ../include/log4cpp/Appender.hh:25,
                     from ../include/log4cpp/AppenderSkeleton.hh:14,
                     from AppenderSkeleton.cpp:11:
    ../include/log4cpp/threading/PThreads.hh:12: warning: "_GNU_SOURCE" redefined
       12 | #define _GNU_SOURCE //added for cygwin compatibility
          | 
    <command-line>: note: this is the location of the previous definition
    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../include -I../include -Wall -Wno-unused -pedantic -MT AppenderSkeleton.lo -MD -MP -MF .deps/AppenderSkeleton.Tpo -c AppenderSkeleton.cpp -o AppenderSkeleton.o >/dev/null 2>&1
    mv -f .deps/AppenderSkeleton.Tpo .deps/AppenderSkeleton.Plo
    
    The warnings might be worked around with fix changed to
    #ifndef _GNU_SOURCE
    #define _GNU_SOURCE //added for cygwin compatibility
    #endif
    

    The change is proposed a while go. Since I do not have cygwin env to try the build, I can not check whether compilation with cygwin goes well now or still not.
    Could you try it out with the modern environment please (both cygwin and log4cpp)?
    Perhaps there was a change since then which would make these macro unnecessary for compilation on cygwin.

    Thanks

     
  • Alexander Perepelkin

    • Status: open --> rejected
     

Log in to post a comment.

MongoDB Logo MongoDB