User: Password:
|
|
Subscribe / Log in / New account

Object-oriented design patterns in the kernel, part 2

Object-oriented design patterns in the kernel, part 2

Posted Jun 9, 2011 15:34 UTC (Thu) by jwakely (guest, #60262)
In reply to: Object-oriented design patterns in the kernel, part 2 by tialaramex
Parent article: Object-oriented design patterns in the kernel, part 2

The standard does *not* require any warnings. The diagnostics it requires are for violations of syntax rules or constraints, not for warning about questionable constructs.

The standard says something works or it doesn't, it never says "this is ok but the implementation should warn about it", so cesarb is quite right, C99 could not have added a warning, and requests for such a warning should go to compiler implementations not the standard.


(Log in to post comments)

Object-oriented design patterns in the kernel, part 2

Posted Jun 10, 2011 3:40 UTC (Fri) by jzbiciak (subscriber, #5246) [Link]

That's largely true. I did find at least one place (and there are likely others) where the standard suggests a warning. It doesn't mandate it though, in ยง6.4.4.2:

Recommended practice

The implementation should produce a diagnostic message if a hexadecimal constant cannot be represented exactly in its evaluation format; the implementation should then proceed with the translation of the program.

If "produc[ing] a diagnostic" and "proceed[ing] with the translation of the program" doesn't constitute a warning, I don't know what does.


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds