Menu

#1984 _wmkdir and _wrmdir not declared

WSL
closed
None
Bug
fixed
Feature_in_WSL_4.0
False
2014-08-20
2013-06-06
No

This regression has arisen in the interval between my last commit on WSL master, and current HEAD on WSL 4.0-dev.

setup.cpp is a C++ source component for mingw-get-setup.exe; when I attempt to compile it today, after updating my headers to 4.0-dev HEAD, I see:

setup.cpp: In function `bool mkdir_default(wchar_t*)':
setup.cpp:540: error: `_wmkdir' was not declared in this scope
setup.cpp: In function `void rmdir_default(const wchar_t*, const wchar_t*)':
setup.cpp:565: error: `_wrmdir' was not declared in this scope

According to:
http://msdn.microsoft.com/en-us/library/2fkk4dzw.aspx

_wmkdir should be prototyped when either direct.h or wchar.h is included.

Likewise, according to:
http://msdn.microsoft.com/en-us/library/wt8es881.aspx

_wrmdir should be prototyped when either of this same pair of headers is included.

setup.cpp includes wchar.h; it does not include direct.h; (the regression is masked, if I do also include direct.h, so it appears to arise explicitly in wchar.h).

Related

Issues: #1973
Issues: #1975

Discussion

  • Keith Marshall

    Keith Marshall - 2013-06-06

    Yep; wchar.h looks well and truly hosed. There's an unclosed C style comment on line 451, but closing that exposes an #endif without matching #if error at line 653. That's not where the error really lies; it's just the last line in the file, which happens to be an #endif line, and there are too many #endifs preceding it.

    On line 230, there's an #endif which proclaims that it closes a _WTIME_DEFINED block, (presumably beginning with the #ifndef _WTIME_DEFINED on line 189); it actually closes the #ifndef RC_INVOKED block starting at line 60. Block nesting between lines 208 and 230 looks especially suspect, but the whole caboodle is in such a mess that I've no idea where to even begin trying to fix it.

     
  • Keith Marshall

    Keith Marshall - 2013-06-08

    I believe I've found the block nesting error, but I need to do some more testing to be certain. Some more recent commits seem to have compounded the breakage, and I'm also seeing evidence of malformation in stat.h.

     
  • Earnie Boyd

    Earnie Boyd - 2013-06-10

    Both the unterminated comment and the mis-appropriated #endif should be resolved in the 4.0-dev branch. I remember finding these and fixing them.

    https://sourceforge.net/p/mingw/mingw-org-wsl/ci/4.0-dev/tree/include/wchar.h

    The stat.h file has a misplaced extern "C"{ opening block that will be resolved soon.

     
  • Earnie Boyd

    Earnie Boyd - 2013-06-10

    With recent changes in my working directory I've no trouble building the following code.

    #include <wchar.h>
    int main(void) {
      _wmkdir(L"mytestdir");
      _wrmdir(L"mytestdir");
      return 0;
    }
    
     
    • Keith Marshall

      Keith Marshall - 2013-06-11

      After making adjustments, as I've noted on [#1973], this is no longer a problem for me either. However, this isn't the end of the saga; those same adjustments have simply served to expose another fatal inconsistency between wchar.h and sys/stat.h, which I think will be better discussed in the context of [#1973].

       

      Related

      Issues: #1973

  • Earnie Boyd

    Earnie Boyd - 2013-06-11

    I'm attaching the patches against 4.0-dev that I have in my current working directory. Some of the changes allowed GCC to tell me where the problem was. Some of the changes allowed my IDE to give me better information. I'm currently using NetBeans just for THOI. With these changes I was able to build the example above.

     
    • Earnie Boyd

      Earnie Boyd - 2013-06-11

      And I'm able to build this

      #include <wchar.h>
      #include <stat.h>
      int main (void) {return 0;}
      
       
      • Keith Marshall

        Keith Marshall - 2013-06-11

        But, as my follow up on [#1973] shows, that isn't sufficient to expose the deeper issues.

         

        Related

        Issues: #1973

  • Earnie Boyd

    Earnie Boyd - 2013-06-16
    • status: unread --> closed
    • Resolution: none --> fixed
    • Category: Unknown --> Feature_in_WSL_4.0
     
  • Earnie Boyd

    Earnie Boyd - 2013-06-16

    This should be resolved in the current 4.0-dev branch.

     
MongoDB Logo MongoDB