tech-userlevel archive

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

Re: major/minor(3) macros conflict with regular code



On Friday  7 Feb 2025, at 13:22, Greg A. Woods wrote:
> That was the point of my mentioning their history -- it's unlikely
> anyone is willing to risk change such long-standing system C code just
> to work around some non-C problems with one or a very few applications.

That was also the point of my asking the question :)
Just in case the change would have seemed harmless to knowledgable
people ... But I definitely get your point.

> > Well, the code is just:
> > message Version
> > {
> >   int32 major = 1;
> >   int32 minor = 2;
> > }
>
> So, I'm definitely not a C++ programmer, but wouldn't this be so
> easy as changing the member names?
>
> 	message Version {
> 		int32 my_protocol_major = 1;
> 		int32 my_protocol_minor = 2;
> 	}

Sure. If that would be my own code and/or if updating this wouldn't
break anything that depends on it, then yes.

In this case, I can't change the code. But I definitely can add
compile options to use _POSIX_C_SOURCE. So not too bad in the end.

Thanks for the insights!



Home | Main Index | Thread Index | Old Index