This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: a question about const and pure functions.


    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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]