ionescu007 / SimpleVisor

SimpleVisor is a simple, portable, Intel VT-x hypervisor with two specific goals: using the least amount of assembly code (10 lines), and having the smallest amount of VMX-related code to support dynamic hyperjacking and unhyperjacking (that is, virtualizing the host state from within the host). It works on Windows and UEFI.
http://ionescu007.github.io/SimpleVisor/
1.69k stars 259 forks source link

reserved identifier violation #18

Closed elfring closed 7 years ago

elfring commented 7 years ago

I would like to point out that identifiers like “_SHV_VP_STATE” and “_KDESCRIPTORdo not fit to the expected naming convention of the C language standard. Would you like to adjust your selection for unique names?

ionescu007 commented 7 years ago

Hi Markus,

This is the standard convention used Windows-based kernel programming.

Best regards, Alex Ionescu

On Sun, Feb 26, 2017 at 11:26 AM, Markus Elfring notifications@github.com wrote:

I would like to point out that identifiers like “_SHV_VP_STATE https://github.com/ionescu007/SimpleVisor/blob/f5dd1af02f22e2caf564dea4705bce2d42167061/shv.h#L35” and “_KDESCRIPTOR https://github.com/ionescu007/SimpleVisor/blob/84c5f91b4c2c86438dfa703f514c5dbf05eddf03/vmx.h#L40” do not fit https://www.securecoding.cert.org/confluence/display/c/DCL37-C.+Do+not+declare+or+define+a+reserved+identifier to the expected naming convention of the C language standard. Would you like to adjust your selection for unique names?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ionescu007/SimpleVisor/issues/18, or mute the thread https://github.com/notifications/unsubscribe-auth/AFxIeL636_xkJSphfVbgfsg5PY85S0yQks5rgWFRgaJpZM4MMWZB .

elfring commented 7 years ago

How do you think about to avoid that this software depends on undefined behaviour?

ionescu007 commented 7 years ago

Markus,

Almost all C-based software in the world (Linux with its t, which the page you linked on says is a violation, and Windows with its leading ) uses underscores in its type names. It does not make any sense to me to go around changing the codebase, and making it look alien to any other developer familiar with real software, to satisfy some bureaucratic requirement that has no real life impact.

Best regards, Alex Ionescu

On Sun, Feb 26, 2017 at 6:21 PM, Markus Elfring notifications@github.com wrote:

How do you think about to avoid that this software depends on undefined behaviour https://www.securecoding.cert.org/confluence/display/c/CC.+Undefined+Behavior#CC.UndefinedBehavior-ub_106 ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ionescu007/SimpleVisor/issues/18#issuecomment-282575470, or mute the thread https://github.com/notifications/unsubscribe-auth/AFxIeIalHVz8mzklni1VeAm1Z2c2BVVPks5rgcKRgaJpZM4MMWZB .

elfring commented 7 years ago

I suggest to use a few underscores less in affected identifiers.

hlide commented 7 years ago

meseems elfring is a spambot.