title: Polyspace alerts about use of system-defined parameter flags for system functions
body: <p>I am working with Polyspace Code Prover and Bug Finder to perform the static analysis of my Linux application written in C.</p>
  
  <p>We are getting several alerts regarding the use of flags as defined by the "man" pages of said calls. In the man pages of functions like open(), write() or syslog(), we can see that they have a parameter which we can pass as an OR of several flags defined by the interface, like in the following example:</p>
  
  <pre><code>fd_value = shm_open(shm_key, O_CREAT | O_RDWR | O_EXCL , S_IRWXU);
  </code></pre>
  
  <p>Polyspace complains that, in the example above, the flags <code>O_CREAT</code>, <code>O_RDWR</code> and <code>O_EXCL</code> are of different essential types (some unsigned, some signed), and thus such an OR operation is not recommended. This is true according to MISRA's 10.1 guideline, but if that's how the system defines its API and its values what can I do about it? Seems to me like casting the values just to make the tool happy is risky.</p>
  
  <p>Is there any other way around the problem besides justifying those violations?</p>
  
  <p>Thank you, best regards!</p>