Using bit fields in interrupt-driven applications
CORRECTION: As Ben (and other commenters) have pointed out, clearing the status flag in the main code is a problem. Writes to bit fields are normally implemented as a read-modify-write, where (in your case) the full byte is read, then one bit is set or cleared, then the modified byte is written back. In pseudo-code, ISRstatus.ISR0 = 0 would become:

char temp = ISRstatus;
temp &amp;= ~0x01;
ISRstatus = temp;


The problem here is that an interrupt can come in the middle of this sequence. For example, let's say that the ISR0 flag is set and interrupt 5 comes in. What happens is:

&lt;interrupt 0&gt;
    ISRstatus |= 0x01;  //Not really atomic, but it doesn't matter here
&lt;exit interrupt 0&gt;

if (ISRstatus.ISR0)
{
    char temp = ISRstatus;
    temp &amp;= ~0x01;
    &lt;interrupt 5&gt;
        ISRstatus |= 0x20;  //Not really atomic, but it doesn't matter here
    &lt;exit interrupt 5&gt;
    ISRstatus = temp;
}


In this example, ISRstatus should be equal to 0x20 after the if statement, but instead it's equal to 0x00. The ISR5 flag got lost.

The way to fix this is to disable interrupts when writing to the global variable in your main code. (Reads are safe as long as the entire structure is loaded at once, which it should be for an 8-bit structure.)

The C standard does not guarantee any particular ordering or packing of bit fields. This means that using bit fields to access data stored in a specific format (like register or packet header fields) is not portable. If there's only one compiler for your CPU, portability won't be a problem, so you can get away with it.

My reading of the standard is that bit fields are intended to be used in exactly the way you're using them. Just keep the limitations in mind.

EDIT v2: The compiler probably won't let a single bit field cross a storage unit boundary. Your compiler manual should have more information, but it might take some trial and error to figure out the edge cases. Since all you care about is the data in the individual fields and not their arrangement within the storage unit, this shouldn't matter.

All that being said, portability is usually not a huge concern for interrupt code, and it's unlikely for a compiler to change the way it handles bit fields in a newer version.