Kenneth Graunke <kenn...@whitecape.org> writes: > On 05/31/2012 04:28 PM, Roland Mainz wrote: >> On Fri, Jun 1, 2012 at 1:19 AM, Kenneth Graunke<kenn...@whitecape.org> >> wrote: >>> switch (name) { >>> case GL_VENDOR: >>> - return (GLubyte *) "Tungsten Graphics, Inc"; >>> + return (GLubyte *) "Intel® Open Source Technology Center"; >>> break; >> >> Uhm... isn't "®" a character outside the ASCII range ? Some compiles >> might choke on this, i.e. the Sun Workshop/Forte/Studio compilers >> require -xcsi ("... This option allows the C compiler to accept source >> code written in locales that do not conform to the ISO C source >> character code requirements. These locales include ja_JP.PCK ...") to >> avoid occasional hiccups. > > I'm happy to change it if it's an issue, but I believe that the ® > character already appears in the source code: > > case PCI_CHIP_GM45_GM: > chipset = "Mobile Intel® GM45 Express Chipset"; > break;
I believe the C89 specification disallows the use of characters outside the basic character set in the source file. The "basic character set" is a subset of the characters representable by ASCII. Or alternatively, that it leaves the effect "implementation-defined" or maybe even "undefined". But I don't have the C89 specification lying around to check. I expect many compilers will accept such characters, and interpret them according to the current locale. So what character you end up with depends on which locale you compile in, or which locale you run the application in. This may lead some compilers to generate warnings about this situation. C++03 allows those characters, but their interpretation is "implementation-defined". C++03 supports the construct '\u00a9', which represents the unicode character U+00A9. I doubt C89 does the same. For string literals the '\xa9' construct can be used, but its interpretation is also "implementation-defined" (at least as far as which character it represents, given that the execution character set is implementation-defined). And keep in mind that '\xa9' must not be followed by a hexadecimal digit. > and it definitely appears in comments. That's less of an issue, since the compiler is quite likely to just ignore those. eirik _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev