[openamq-dev] Should parameters in WireAPI should be const when possible ?

blog blog at yankeeboysoftware.com
Tue Dec 18 10:09:18 CET 2007


Using the WireAPI functions 

amq_content_basic_set_body
amq_content_basic_set_message_id
amq_client_session_basic_publish

is problematic due to the prototypes not declaring the byte* data parameter 'const'.
There can be no reason for the WireAPI to modify the passed in "byte *data", 
and good programming discipline dictates that these parameters should be const when appropriate.

I understand fixing this *may* break legacy applications.  
Those applications that rely upon non-const'ness, are already broken anyway.

I am willing to supply a patch for this, but am opening a discussion beforehand.

Comments welcome.




More information about the openamq-dev mailing list