Skip to content
Snippets Groups Projects
  1. Nov 30, 2018
    • Linus Torvalds's avatar
      unifdef: use memcpy instead of strncpy · 38c7b224
      Linus Torvalds authored
      
      New versions of gcc reasonably warn about the odd pattern of
      
      	strncpy(p, q, strlen(q));
      
      which really doesn't make sense: the strncpy() ends up being just a slow
      and odd way to write memcpy() in this case.
      
      There was a comment about _why_ the code used strncpy - to avoid the
      terminating NUL byte, but memcpy does the same and avoids the warning.
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      38c7b224
  2. Jan 22, 2011
    • Tony Finch's avatar
      unifdef: update to upstream version 2.5 · 3cbea436
      Tony Finch authored
      
      Fix a long-standing cpp compatibility bug. The -DFOO argument
      (without an explicit value) should define FOO to 1 not to the empty
      string.
      
      Add a -o option to support overwriting a file in place, and a -S
      option to list the nesting depth of symbols. Include line numbers
      in debugging output. Support CRLF newlines.
      
      Signed-off-by: default avatarTony Finch <dot@dotat.at>
      Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
      3cbea436
  3. Dec 12, 2009
  4. Jun 09, 2009
    • Russell King's avatar
      kbuild: fix headers_exports with boolean expression · eedc9d83
      Russell King authored
      
      When we had code like this in a header unifdef failed to
      deduct that the expression was always false - and we had code exported
      that was not intended for userspace.
      
      #if defined(__KERNEL__) && !defined(__ASSEMBLY__)
        int a;
      #endif
      
      This commit implment support in unidef which allows it to work out if
      an #if expression always evaluates true or false for symbols which
      are being undefined/always defined.
      
      The patch is slightly more complicated than I'd hoped because unifdef
      needs to see lines fully evaluated - doing otherwise causes it to
      mark the line as "dirty" and copy it over no matter what.
      
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      eedc9d83
  5. Mar 07, 2009
  6. Sep 25, 2006
Loading