Skip to content
Snippets Groups Projects
Forked from Utils / KWSys
Source project has a limited visibility.
  • Hans Johnson's avatar
    acc916ed
    COMP: Prefer const pointer when value does not change · acc916ed
    Hans Johnson authored
    The check finds function parameters of a pointer type that could be changed to
    point to a constant type instead.
    
    When const is used properly, many mistakes can be avoided. Advantages when
    using const properly:
     - prevent unintentional modification of data;
     - get additional warnings such as using uninitialized data;
     - make it easier for developers to see possible side effects.
    
    This check is not strict about constness, it only warns when the constness will
    make the function interface safer.
    acc916ed
    History
    COMP: Prefer const pointer when value does not change
    Hans Johnson authored
    The check finds function parameters of a pointer type that could be changed to
    point to a constant type instead.
    
    When const is used properly, many mistakes can be avoided. Advantages when
    using const properly:
     - prevent unintentional modification of data;
     - get additional warnings such as using uninitialized data;
     - make it easier for developers to see possible side effects.
    
    This check is not strict about constness, it only warns when the constness will
    make the function interface safer.