<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>15114</bug_id>
          
          <creation_ts>2007-08-29 14:41:07 -0700</creation_ts>
          <short_desc>Provide compile-time assertions for sizeof(UChar), sizeof(DeprecatedChar), etc.</short_desc>
          <delta_ts>2009-01-04 10:13:17 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Template Framework</component>
          <version>523.x (Safari 3)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="Darin Adler">darin</assigned_to>
          <cc>ggaren</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1221</commentid>
    <comment_count>0</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-08-29 14:41:07 -0700</bug_when>
    <thetext>* SUMMARY
The UChar and DeprecatedChar structs have implicit assumptions that they are two bytes on all platforms.  It would be nice if there were compile-time assertions that prevented the project from compiling if these assumptions are ever violated.

* NOTES
A Google search yielded some solutions:

Compile Time Assertions in C (CVu 11.3)
http://www.jaggersoft.com/pubs/CVu11_3.html

Compile-Time Assertions &amp; Debugging
http://www.ddj.com/development-tools/184402051

Compile-Time Assertions
http://www.ddj.com/architect/184401873</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1220</commentid>
    <comment_count>1</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2007-08-29 15:56:01 -0700</bug_when>
    <thetext>If this is possible, it would be really helpful to check sizeof all JSObject subclasses at compile time. The collector assumes a maximum size, but it&apos;s not checked at compile time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71845</commentid>
    <comment_count>2</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2008-02-24 23:03:30 -0800</bug_when>
    <thetext>wtf/Assertions.h has COMPILE_ASSERT, so we just need to use it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104346</commentid>
    <comment_count>3</comment_count>
      <attachid>26413</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-01-04 09:47:20 -0800</bug_when>
    <thetext>Created attachment 26413
patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104348</commentid>
    <comment_count>4</comment_count>
      <attachid>26413</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2009-01-04 09:55:28 -0800</bug_when>
    <thetext>Comment on attachment 26413
patch

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104351</commentid>
    <comment_count>5</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-01-04 10:13:17 -0800</bug_when>
    <thetext>http://trac.webkit.org/changeset/39585</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>26413</attachid>
            <date>2009-01-04 09:47:20 -0800</date>
            <delta_ts>2009-01-04 09:55:28 -0800</delta_ts>
            <desc>patch</desc>
            <filename>UCharSizePatch.txt</filename>
            <type>text/plain</type>
            <size>1173</size>
            <attacher name="Darin Adler">darin</attacher>
            
              <data encoding="base64">SW5kZXg6IEphdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09P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ICiAjZGVmaW5lIFdURl9VTklDT0RFX0gK
IAotI2luY2x1ZGUgPHd0Zi9QbGF0Zm9ybS5oPgorI2luY2x1ZGUgPHd0Zi9Bc3NlcnRpb25zLmg+
CiAKICNpZiBVU0UoUVQ0X1VOSUNPREUpCiAjaW5jbHVkZSAicXQ0L1VuaWNvZGVRdDQuaCIKQEAg
LTMyLDQgKzMyLDYgQEAKICNlcnJvciAiVW5rbm93biBVbmljb2RlIGltcGxlbWVudGF0aW9uIgog
I2VuZGlmCiAKK0NPTVBJTEVfQVNTRVJUKHNpemVvZihVQ2hhcikgPT0gMiwgVUNoYXJJc1R3b0J5
dGVzKTsKKwogI2VuZGlmIC8vIFdURl9VTklDT0RFX0gK
</data>
<flag name="review"
          id="12522"
          type_id="1"
          status="+"
          setter="ddkilzer"
    />
          </attachment>
      

    </bug>

</bugzilla>