Re: [HTCondor-devel] Conflicting hold codes?


Date: Fri, 10 May 2013 08:02:02 -0500
From: Brian Bockelman <bbockelm@xxxxxxxxxxx>
Subject: Re: [HTCondor-devel] Conflicting hold codes?
On May 9, 2013, at 8:40 AM, Greg Thain <gthain@xxxxxxxxxxx> wrote:

> On 05/09/2013 08:14 AM, Brian Bockelman wrote:
>> 
>> Is there a reason we need the C-style linkage here?  Wouldn't we get more mileage if we used an enum and had the compiler watching our back?
>> 
>> 
> 
> As these numbers are visible to users in the HoldCode attrtibute, they need to be constant across condor versions, which is a bit of a trick to get right.  If we rely on an enum, it is easy to have the values of the hold codes change across versions, say by a funny merge, in a way that's hard to detect just by looking at one version of the source.
> 

Hi Greg,

Why not do something like:

enum hold_codes {
  unspecified = 1,
  foo = 2,
  outofresources = 3
};

?  That way, we can keep stable across series and detect overlaps at compile-time.

Brian

Attachment: smime.p7s
Description: S/MIME cryptographic signature

[← Prev in Thread] Current Thread [Next in Thread→]