Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Code issues] MSVC Compiler warnings and MS Code analysis #1375

Closed
driekus77 opened this issue Jul 23, 2015 · 4 comments
Closed

[Code issues] MSVC Compiler warnings and MS Code analysis #1375

driekus77 opened this issue Jul 23, 2015 · 4 comments

Comments

@driekus77
Copy link

I've cloned the master of today build with MSVC and removed the warnings and switched on Code Analysis. This code analysis returns some possible issues:

c:\atwork\develop\dotsass\libsass\src\ast.cpp(35): warning C6287: Redundant code: the left and right sub-expressions are identical.
c:\atwork\develop\dotsass\libsass\src\ast.cpp(679): warning C6011: Dereferencing NULL pointer 'l'.
c:\atwork\develop\dotsass\libsass\src\ast.cpp(726): warning C6287: Redundant code: the left and right sub-expressions are identical.
c:\atwork\develop\dotsass\libsass\src\ast.cpp(1146): warning C6011: Dereferencing NULL pointer 'c'.
c:\atwork\develop\dotsass\libsass\src\ast.cpp(1158): warning C6011: Dereferencing NULL pointer 'pIter'. See line 1146 for an earlier location where this can occur
c:\atwork\develop\dotsass\libsass\src\ast.cpp(1686): warning C28182: Dereferencing NULL pointer. 'key' contains the same NULL value as 'v_key' did.
c:\atwork\develop\dotsass\libsass\src\ast.cpp(1709): warning C28182: Dereferencing NULL pointer. 'item' contains the same NULL value as 'v_val=dynamic_cast<Sass::Value *>item, v_val' did.
c:\atwork\develop\dotsass\libsass\src\context.cpp(152): warning C6001: Using uninitialized memory '_strings.'.
c:\atwork\develop\dotsass\libsass\src\context.cpp(150): warning C6001: Using uninitialized memory '_sources.'.
c:\atwork\develop\dotsass\libsass\src\eval.cpp(719): warning C6011: Dereferencing NULL pointer 'value'.
c:\atwork\develop\dotsass\libsass\src\eval.cpp(1103): warning C28182: Dereferencing NULL pointer. 'lhs' contains the same NULL value as 'l' did.
c:\atwork\develop\dotsass\libsass\src\eval.cpp(1104): warning C28182: Dereferencing NULL pointer. 'rhs' contains the same NULL value as 'r' did.
c:\atwork\develop\dotsass\libsass\src\eval.cpp(1106): warning C6011: Dereferencing NULL pointer 'r'. See line 1104 for an earlier location where this can occur
c:\atwork\develop\dotsass\libsass\src\expand.cpp(134): warning C28182: Dereferencing NULL pointer. 'stm' contains the same NULL value as 'dec=static_cast<Sass::Declaration *>stm, dec' did.
c:\atwork\develop\dotsass\libsass\src\file.cpp(313): warning C6031: Return value ignored: 'ReadFile'.
c:\atwork\develop\dotsass\libsass\src\json.cpp(115): warning C6308: 'realloc' might return null pointer: assigning null pointer to 'sb->start', which is passed as an argument to 'realloc', will cause the original memory block to be leaked.
c:\atwork\develop\dotsass\libsass\src\parser.cpp(1024): warning C6011: Dereferencing NULL pointer 'prop'.
c:\atwork\develop\dotsass\libsass\src\parser.cpp(1988): warning C6011: Dereferencing NULL pointer 'declaration'.
c:\atwork\develop\dotsass\libsass\src\sass_interface.cpp(40): warning C6011: Dereferencing NULL pointer 'arr[i-skip]'.
c:\atwork\develop\dotsass\libsass\src\sass_interface.cpp(43): warning C6011: Dereferencing NULL pointer 'arr'.
c:\atwork\develop\dotsass\libsass\src\util.cpp(604): warning C6011: Dereferencing NULL pointer 'stm'.
c:\atwork\develop\dotsass\libsass\src\util.cpp(629): warning C28182: Dereferencing NULL pointer. 'stm' contains the same NULL value as 'child=dynamic_cast<Sass::Has_Block *>stm, child' did.
c:\atwork\develop\dotsass\libsass\src\util.cpp(645): warning C6011: Dereferencing NULL pointer 'stm'.

Will somebody of you fix these issues soon? If not, I'm willing to create a fork and commit them myself.
I already looked at some of them and they seem to me things that realy can go wrong. Especcially the "Dereferencing NULL pointer" warnings.

Hope to hear from you.

Kind regards,
Henry

@driekus77
Copy link
Author

Oke I fixed most of the warnings and code analysis issues in a fork:
https://github.com/driekus77/libsass

After that I tested by compiling foundation and bootstrap with sassc.

I hope the fixes are usefull.

Kind regards,

Henry

@xzyfer
Copy link
Contributor

xzyfer commented Jul 24, 2015

Thanks for the report @driekus77. Could you please pull request from your fork?

@driekus77
Copy link
Author

Thanks for quick respons!

I have created a pull request:
#1378

Kind regards,
Henry

Verstuurd vanaf mijn iPhone

Op 24 jul. 2015 om 10:38 heeft Michael Mifsud notifications@github.com het volgende geschreven:

Thanks for the report @driekus77. Could you please pull request from your fork?


Reply to this email directly or view it on GitHub.

@xzyfer
Copy link
Contributor

xzyfer commented Aug 4, 2015

Fixed via #1423

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants