Re: Why is not const used for parameters in the socket API?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 26, 2014 at 08:27:01AM +0100, Roger Nyberg wrote:
> 
> Why isn't const used in the socket API to make it clearer?
> Example:
>  
> int sctp_sendmsg(int s, const void *msg, size_t len, struct sockaddr
> *to,
>                  socklen_t tolen, uint32_t ppid, uint32_t flags,
>                  uint16_t stream_no, uint32_t timetolive, uint32_t
> context);
> 
> If i am not missing something, i guess the "struct sockaddr *to" could
> be const (that is: "const struct sockaddr *to").
> 
> Please use const for every paramater where it is possible. This makes
> usage simpler. There are more functions than the (sctp_sendmsg) where
> parameters can const.
> 

Send a patch?

Neil

> /Roger
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Networking Development]     [Linux OMAP]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux