

Re-checking the ReactOS project - a large report - AndreyKarpov
http://www.viva64.com/en/b/0192/

======
Maxious
See previously John Carmack on the importance of static analysis
[http://www.altdevblogaday.com/2011/12/24/static-code-
analysi...](http://www.altdevblogaday.com/2011/12/24/static-code-analysis/)
<https://news.ycombinator.com/item?id=4543553>

------
johnsoft
From the title, I was expecting to read a review of ReactOS looking at whether
it would be viable as a day-to-day OS. This leaves me a little bit
disappointed.

~~~
gecko
Okay, I'll write that review:

No.

It's unstable, it lacks support for any filesystem but FAT32, it lacks
meaningful driver compatibility with Windows, it doesn't support multiple
users, it doesn't support major APIs like thread pools/WMI/WDDM, its TCP stack
is nascent, there is no SMB support...

I want this project to succeed, but it needs a _lot_ of love to get there.

------
microtherion
One of the NULL dereference diagnostics looks spurious:

    
    
      DomainName = &PolicyAccountDomainInfo->DomainName;
      SidNameUse = (PolicyAccountDomainInfo != NULL ?
                    SidTypeGroup : SidTypeUser);
    

This does not, in fact, dereference PolicyAccountDomainInfo, but simply
performs some pointer arithmetic. It’s bad style, agreed, but should be
entirely harmless to execute.

~~~
pkolaczk
Doing _anything_ with invalid pointers is UB in C++. It might be fine now, but
it might not work in 5 years, when compiled with a newer compiler.

E.g. a sufficiently clever, malicious compiler could reason that because you
are doing pointer arithmetic involving PolicyAccountDomainInfo->, the pointer
must be valid and then it might get rid of the null check and branch in the
second line. I remember not so long ago there was a vulnerability in Linux
kernel because of exactly this kind of "malicious" optimisation performed by
gcc.

~~~
microtherion
As others have commented, the Linux incident involved an actual dereferencing
of the pointer.

The way I read <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf> top
of page 89 and footnote 102 on that page is that this is NOT undefined
behavior in C, and though I haven’t checked the corresponding language in the
C++ standard, I would think it’s not undefined in C++ either.

------
melling
Are there good low-end tools for C/C++? I've been doing iOS development and I
recently decided to write some of my code in C++ so it would be portable to
Android and Blackberry.

~~~
micampe
If you’ve been working on iOS you already have it installed <http://clang-
analyzer.llvm.org>

~~~
melling
Yes, Xcode with clang is really nice. After reading Carmack's blog, however,
I'm sure more can be done. He actually like's Microsoft's compiler. Wonder if
it's worth running code through it?

------
pkolaczk
Hmm, don't ReactOS developers use IDEs? Or do C++ IDEs lack advanced static
analysis features?

~~~
TazeTSchnitzel
It depends. Some of us use Visual Studio. Some of us use gedit.

~~~
fabriceleal
If you do use Visual Studio, it would be interesting to know what do you think
about its static analysis (or absence of)

------
topbanana
Interesting project. Is it fairly easy to get up and running as a contributor?

~~~
TazeTSchnitzel
Yes! There's a single build environment (RosBe) to download (for both Windows
and *NIX), then you just need to do an svn checkout (svn is included in the
environment), and then make a patch and submit it for some bug.

