a question about const and pure functions.

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Thu Nov 11 15:45:00 GMT 2004


    So write it down.

You have to agree on them first!  At least one language standardization
committee spent many hours on the question of pure and memoization.

    But your example is obvious - if the function is passed a pointer and
    it modifies it, that is clearly a side-effect because it is a a change
    that cannot be seen directly from the caller's side.

I agree that it should be considered a side-effect, but that makes the
definition of "side-effect" a little harder to state.



More information about the Gcc mailing list