{"push_id":928612491,"size":8,"distinct_size":1,"ref":"refs/heads/Bert","head":"98915b9c112ed03b49698048a8414a2e6b3164d2","before":"34a88c3f19175579bb849c662788247c71ffaa54","commits":[{"sha":"34d12cb76b3dc448affcc71879cc57a25f577e80","author":{"email":"86d8eb109fa687c9e00a3835bb4d60f543689470@unisys.com","name":"Tim Sell"},"message":"correct search order of dirs specified via 'sonar.cxx.includeDirectories'\n\nPreviously, the include directories specified via 'sonar.cxx.includeDirectories'\nwere not necessarily searched in the order specified.  This patch corrects the\nproblem by storing the include paths as a list instead of a hash.\n\nThis toy project illustrates the problem, and verifies the fix:\n```\n[selltc@mac src]$ l\ntotal 60\ndrwxr-xr-x  6 selltc selltc  4096 Jan  5 09:08 .\ndrwxrwxrwt 67 root   root   20480 Jan  5 09:08 ..\ndrwxr-xr-x  2 selltc selltc  4096 Jan  5 09:06 inc1\ndrwxr-xr-x  2 selltc selltc  4096 Jan  5 09:08 inc2\ndrwxr-xr-x  2 selltc selltc  4096 Jan  5 09:08 inc3\n-rw-r--r--  1 selltc selltc   172 Jan  5 08:52 sonar-project.properties\n-rw-r--r--  1 selltc selltc    30 Jan  5 09:08 x.c\n[selltc@mac src]$ cat sonar-project.properties\nsonar.projectKey=proj\nsonar.projectName=proj\nsonar.sources=x.c\nsonar.log.level=DEBUG\nsonar.cxx.cppcheck.reportPath=cppcheck.xml\nsonar.cxx.includeDirectories=inc1,inc2,inc3\n[selltc@mac src]$ cat x.c\n#include \"x.h\"\n\nint main() {}\n[selltc@mac src]$ l inc1\ntotal 8\ndrwxr-xr-x 2 selltc selltc 4096 Jan  5 09:06 .\ndrwxr-xr-x 6 selltc selltc 4096 Jan  5 09:08 ..\n[selltc@mac src]$ l inc2\ntotal 12\ndrwxr-xr-x 2 selltc selltc 4096 Jan  5 09:08 .\ndrwxr-xr-x 6 selltc selltc 4096 Jan  5 09:08 ..\n-rw-r--r-- 1 selltc selltc   38 Jan  5 08:39 x.h\n[selltc@mac src]$ l inc3\ntotal 12\ndrwxr-xr-x 2 selltc selltc 4096 Jan  5 09:08 .\ndrwxr-xr-x 6 selltc selltc 4096 Jan  5 09:08 ..\n-rw-r--r-- 1 selltc selltc   38 Jan  5 08:39 x.h\n[selltc@mac src]$ cat inc2/x.h\nint f2()\n{\n    char *p2;\n    *p2=0;\n}\n[selltc@mac src]$ cat inc3/x.h\nint f3()\n{\n    char *p3;\n    *p3=0;\n}\n[selltc@mac src]$ cppcheck --enable=all --xml -Iinc1 -Iinc2 -Iinc3 x.c 2>cppcheck.xml\nChecking x.c...\n[selltc@mac src]$ cat cppcheck.xml\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<results>\n    <error file=\"inc2/x.h\" line=\"3\" id=\"unassignedVariable\" severity=\"style\" msg=\"Variable &apos;p2&apos; is not assigned a value.\"/>\n    <error file=\"inc2/x.h\" line=\"4\" id=\"uninitvar\" severity=\"error\" msg=\"Uninitialized variable: p2\"/>\n</results>\n```\n\nRunning sonar-runner withOUT this patch yields the following output (note the expected search order of inc2 and inc3 is reversed):\n```\n...\n09:10:46.583 INFO  - Sensor CxxSquidSensor\n09:10:46.589 DEBUG - setIncludeDirectories() adding dir 'inc1'\n09:10:46.589 DEBUG - setIncludeDirectories() adding dir 'inc2'\n09:10:46.590 DEBUG - setIncludeDirectories() adding dir 'inc3'\n09:10:46.644 DEBUG - storing include root: '/var/tmp/src/inc1'\n09:10:46.645 DEBUG - storing include root: '/var/tmp/src/inc3'\n09:10:46.645 DEBUG - storing include root: '/var/tmp/src/inc2'\n09:10:46.704 DEBUG - [/var/tmp/src/x.c:1]: processing #include \"x.h\", resolved to file '/var/tmp/src/inc3/x.h'\n09:10:46.720 DEBUG - finished preprocessing '/var/tmp/src/x.c'\n...\n```\n\nThis patch corrects the problem of the include directories being searched in\nthe wrong order (as the above example shows inc3 being searched before inc2).\n\nRunning sonar-runner WITH this patch yields the following output:\n```\n09:21:33.507 INFO  - Sensor CxxSquidSensor\n09:21:33.510 DEBUG - setIncludeDirectories() adding dir 'inc1'\n09:21:33.510 DEBUG - setIncludeDirectories() adding dir 'inc2'\n09:21:33.510 DEBUG - setIncludeDirectories() adding dir 'inc3'\n09:21:33.553 DEBUG - storing include root: '/var/tmp/src/inc1'\n09:21:33.553 DEBUG - storing include root: '/var/tmp/src/inc2'\n09:21:33.553 DEBUG - storing include root: '/var/tmp/src/inc3'\n09:21:33.603 DEBUG - [/var/tmp/src/x.c:1]: processing #include \"x.h\", resolved to file '/var/tmp/src/inc2/x.h'\n```\n\nSee also https://github.com/SonarOpenCommunity/sonar-cxx/issues/745.","distinct":false,"url":"https://api.github.com/repos/Bertk/sonar-cxx/commits/34d12cb76b3dc448affcc71879cc57a25f577e80"},{"sha":"6e61c7a9a898f286322bc83085b17796cf2eb520","author":{"email":"e4d974d607ff0818ca81de86196797f733a6663e@etas.com","name":"Günter Wirth"},"message":"Merge pull request #748 from selltc/master\n\ncorrect search order of dirs specified via 'sonar.cxx.includeDirectories'","distinct":false,"url":"https://api.github.com/repos/Bertk/sonar-cxx/commits/6e61c7a9a898f286322bc83085b17796cf2eb520"},{"sha":"0ce4b44063a61a2a36b060148075000a73fb1342","author":{"email":"e4d974d607ff0818ca81de86196797f733a6663e@etas.com","name":"guwirth"},"message":"NUnit support\n\nupdate sonar-dotnet-tests-library to 1.2\nuse \"sonar.cxx.nunit.reportsPaths\" for NUnit reports\nrename derived classes from MSTestXxx to CxxUnitTestXxx\nclean-up folder structure (tests/xunit and tests/dotnet)\nclose #722","distinct":false,"url":"https://api.github.com/repos/Bertk/sonar-cxx/commits/0ce4b44063a61a2a36b060148075000a73fb1342"},{"sha":"8e83c086e76b8c7526fcf57237019e669ecf6059","author":{"email":"e4d974d607ff0818ca81de86196797f733a6663e@etas.com","name":"guwirth"},"message":"build with SQ 5.3 final version","distinct":false,"url":"https://api.github.com/repos/Bertk/sonar-cxx/commits/8e83c086e76b8c7526fcf57237019e669ecf6059"},{"sha":"62fb855b5110bba94841ae1315a6dc0150ef311d","author":{"email":"e4d974d607ff0818ca81de86196797f733a6663e@etas.com","name":"Günter Wirth"},"message":"Merge pull request #753 from guwirth/enhancement/SQ-5.3-final\n\nbuild with SQ 5.3 final version","distinct":false,"url":"https://api.github.com/repos/Bertk/sonar-cxx/commits/62fb855b5110bba94841ae1315a6dc0150ef311d"},{"sha":"6c52fda98413dab877fcb9896a0226f56c50b646","author":{"email":"e4d974d607ff0818ca81de86196797f733a6663e@etas.com","name":"Günter Wirth"},"message":"Merge pull request #752 from Bertk/fix-tags\n\nremove deprecated squidbridge.annotations.Tags","distinct":false,"url":"https://api.github.com/repos/Bertk/sonar-cxx/commits/6c52fda98413dab877fcb9896a0226f56c50b646"},{"sha":"1c728c7043380db0981afd9e7184b1fd44c1adaa","author":{"email":"e4d974d607ff0818ca81de86196797f733a6663e@etas.com","name":"Günter Wirth"},"message":"Merge pull request #742 from guwirth/enhancement/nunit-tests\n\nNUnit support","distinct":false,"url":"https://api.github.com/repos/Bertk/sonar-cxx/commits/1c728c7043380db0981afd9e7184b1fd44c1adaa"},{"sha":"98915b9c112ed03b49698048a8414a2e6b3164d2","author":{"email":"11d6f07e67a9c27f7659b6a22ce1266572b4191a@hotmail.com","name":"Bert"},"message":"Merge branch 'master' into Bert","distinct":true,"url":"https://api.github.com/repos/Bertk/sonar-cxx/commits/98915b9c112ed03b49698048a8414a2e6b3164d2"}]}