Re: dev process - reduce mistakes

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

 



On Wed, 19 Sep 2018 09:35:36 +1000, "Tobin C. Harding" said:
> Hi,
>
> I'm after some advice from those more experienced with [kernel]
> development please.
>
> What systems do you have in place to help catch mistakes?  In other
> words; what processes do you use when coding and submitting patches to
> help eliminate simple mistakes?

Same way you verify it for any other large programming project.

'make clean && make && make install && shutdown -r now'

1) Verify no compile errors.

2) Verify no unexplained compile warnings. gcc *does* screw up and whine about
things incorrectly on occasion because it doesn't know everything - "variable
may be used uninitialized" is a famous one, usually emitted because there's
program logic it can't see. For instance, code like:

    int oddball;
    for (i=0;i<foo;i++) {
         if (wombat > 5) oddball = 7;
         if (frobozz) quux = oddball;
    }

and there's a reason known to programmer but not compiler
that guarantees that wombat > 5 will always happen at least once
before frobozz becomes true.

But in general, unless you can *prove* the compiler is false-positive on
a warning, fix the warning. ;)

2a) (optional) Install 'sparse' and do a 'make C=2' and see if that complains about
anything that gcc didn't...

3) Test that it actually boots and does whatever your patch is supposed to do.

See? And here you thought it was difficult :)

Attachment: pgpL9e25FinOD.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux