When compiling with /MP, Visual Studio extends warnings with a note

          (compiling source file F:\ull\path.cpp)

      which is parsed as part of the directory, so warnings are shown with a directory name that looks like

         ] (compiling source file F:\ull\path.cpp)F:\ull\path\to\directory

      This also breaks collapsing identical warnings in headers.

          [JENKINS-56450] MSBuild parser fails when compiling with /MP

          Simon Richter added a comment -

          Done.

          Simon Richter added a comment - Done.

          Ulli Hafner added a comment -

          I don't want to be pedantic but a parsers reads the log Are the whitespace at the beginning of the 2nd line correct? (I can't change the comment on my own).

          Ulli Hafner added a comment - I don't want to be pedantic but a parsers reads the log Are the whitespace at the beginning of the 2nd line correct? (I can't change the comment on my own).

          Simon Richter added a comment -

          Yes, these are correct. For C++ templates, this is quite common, these are in principle an extension of the previous message. In theory they can be interleaved with messages from other source files (with cl.exe /MP) and/or projects (with MSBuild /M), the latter is equivalent to the [0-9]+> prefixes generated by VS 2015 and earlier (and some versions of 2017 IIRC). I have never seen the interleaving in effect though, only read about it in bug reports, as this seems to be timing dependent.

          Simon Richter added a comment - Yes, these are correct. For C++ templates, this is quite common, these are in principle an extension of the previous message. In theory they can be interleaved with messages from other source files (with cl.exe /MP) and/or projects (with MSBuild /M), the latter is equivalent to the [0-9] +> prefixes generated by VS 2015 and earlier (and some versions of 2017 IIRC). I have never seen the interleaving in effect though, only read about it in bug reports, as this seems to be timing dependent.

          Ulli Hafner added a comment -

          Ok. So one warning is expected (the note at line 2 is ignored because it starts not at position 1).

          Ulli Hafner added a comment - Ok. So one warning is expected (the note at line 2 is ignored because it starts not at position 1).

          Simon Richter added a comment - - edited

          Yes. In an ideal world, the note would be accessible from the detail view as well (often, these refer to other files in the source tree), but that is probably a larger change (g++ would benefit from that as well though).

          The minimal change required would be to ignore the "compiling source file ..." part in parentheses before the project name (which seems to be somewhat optional, at least I don't see it on every line).

          Long logs for testing if needed:

          Simon Richter added a comment - - edited Yes. In an ideal world, the note would be accessible from the detail view as well (often, these refer to other files in the source tree), but that is probably a larger change (g++ would benefit from that as well though). The minimal change required would be to ignore the "compiling source file ..." part in parentheses before the project name (which seems to be somewhat optional, at least I don't see it on every line). Long logs for testing if needed: MSBuild serial build, with /MP MSBuild /M build, without /MP, 55,000 generated warnings MSBuild /M build, without /MP

          Lorenz Aebi added a comment - - edited

          So the warning message should still be:

           'FOOTPRINT_ASYNC_LOADER::m_last_table': class 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' needs to have dll-interface to be used by clients of class 'FOOTPRINT_ASYNC_LOADER' (compiling source file C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\src\cvpcb\cvpcb_mainframe.cpp)

          But the directory should not contain the file path in the brackets. At the moment I do not see where the directory path is generated... But I will find out or someone gives me a hint.

          Lorenz Aebi added a comment - - edited So the warning message should still be:   'FOOTPRINT_ASYNC_LOADER::m_last_table': class 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' needs to have dll-interface to be used by clients of class 'FOOTPRINT_ASYNC_LOADER' (compiling source file C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\src\cvpcb\cvpcb_mainframe.cpp) But the directory should not contain the file path in the brackets. At the moment I do not see where the directory path is generated... But I will find out or someone gives me a hint.

          Simon Richter added a comment -

          It's totally fine to remove that directory tag from the warning message.

          The bit about the "note:" lines is a bit confusing, that is a separate issue which definitely isn't beginner level anymore, and which I've filed as JENKINS-56815 now.

          Our main problem at the moment is that the build with /MP shows close to 15,000 warnings per configuration, while the non-parallel build only has 1,500 per configuration, as many of these warnings are generated in header files, so these would be collapsed as duplicates, but the source name added to the message makes them unique.

          Simon Richter added a comment - It's totally fine to remove that directory tag from the warning message. The bit about the "note:" lines is a bit confusing, that is a separate issue which definitely isn't beginner level anymore, and which I've filed as JENKINS-56815 now. Our main problem at the moment is that the build with /MP shows close to 15,000 warnings per configuration, while the non-parallel build only has 1,500 per configuration, as many of these warnings are generated in header files, so these would be collapsed as duplicates, but the source name added to the message makes them unique.

          Lorenz Aebi added a comment -

          I found out that your description is not the root of the problem, but log entries like the following leads to a 'wrong' filename detection. I assume that there is a missing protection of the log-generation when several processors generate log messages in parallel:

          C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\src\include\footprint_info.h(320): warning C4251: 'FOOTPRINT_ASYNC_LOADER::m_last_table': class 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' needs to have dll-interface to be used by clients of class 'FOOTPRINT_ASYNC_LOADER' (compiling source file C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\src\pcbnew\footprint_libraries_utils.cpp)C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\src\include\geometry/seg.h(263): warning C4244: 'initializing': conversion from 'double' to 'SEG::ecoord', possible loss of data (compiling source file C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\src\pcbnew\hotkeys_footprint_editor.cpp) [C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\build\pcbnew\pcbnew_kiface_objects.vcxproj]

          I will create a PR to detect such log messages as warning on the first file / message (not able to split the line and create 2 issues).

          Lorenz Aebi added a comment - I found out that your description is not the root of the problem, but log entries like the following leads to a 'wrong' filename detection. I assume that there is a missing protection of the log-generation when several processors generate log messages in parallel: C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\src\include\footprint_info.h(320): warning C4251: 'FOOTPRINT_ASYNC_LOADER::m_last_table': class 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' needs to have dll-interface to be used by clients of class 'FOOTPRINT_ASYNC_LOADER' (compiling source file C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\src\pcbnew\footprint_libraries_utils.cpp)C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\src\include\geometry/seg.h(263): warning C4244: 'initializing': conversion from 'double' to 'SEG::ecoord', possible loss of data (compiling source file C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\src\pcbnew\hotkeys_footprint_editor.cpp) [C:\Jenkins\workspace\windows-kicad-msvc-tom\build\release\cpu\amd64\label\msvc\build\pcbnew\pcbnew_kiface_objects.vcxproj] I will create a PR to detect such log messages as warning on the first file / message (not able to split the line and create 2 issues).

          Marne added a comment -

          We are seeing this issue while using

          • Analysis Model API in Version 10.23.1
          • Warnings Next Generation in Version 9.23.1

          That is the same issue in the same file is reported multiple times. Each time with another file in the "compiling source file" annotation.

          Example log outputs:

          133>C:\jenkins\workspace\develop\file.h(340,78): warning C4239: nonstandard extension used: 'default argument': conversion from 'CSize' to 'CSize &' (compiling source file main.cpp) [C:\jenkins\workspace\develop\project.vcxproj]
          
          175>c:\jenkins\workspace\develop\file.h(76): warning C4100: "Id": Unreferenzierter formaler Parameter (Quelldatei wird kompiliert main.cpp) [C:\jenkins\workspace\develop\project.vcxproj]
          

          Marne added a comment - We are seeing this issue while using Analysis Model API in Version 10.23.1 Warnings Next Generation in Version 9.23.1 That is the same issue in the same file is reported multiple times. Each time with another file in the "compiling source file" annotation. Example log outputs: 133>C:\jenkins\workspace\develop\file.h(340,78): warning C4239: nonstandard extension used: 'default argument': conversion from 'CSize' to 'CSize &' (compiling source file main.cpp) [C:\jenkins\workspace\develop\project.vcxproj] 175>c:\jenkins\workspace\develop\file.h(76): warning C4100: "Id": Unreferenzierter formaler Parameter (Quelldatei wird kompiliert main.cpp) [C:\jenkins\workspace\develop\project.vcxproj]

          Ulli Hafner added a comment -

          Please do not reuse existing issues. Create a new one and attach the log in your console that is wrongly parsed to the result in your comment. It looks like the parser does not select the filename correctly.

          Ulli Hafner added a comment - Please do not reuse existing issues. Create a new one and attach the log in your console that is wrongly parsed to the result in your comment. It looks like the parser does not select the filename correctly.

            laebi Lorenz Aebi
            simonrichter Simon Richter
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: