Right, but the root cause of the problem is that __builtin_va_start uses a reference type in C mode. Your patch is fixing one of the places where that doesn't work. So we have a choice: either we accept the cost of making references work well enough in C to handle this weird case, or we pick a different implementation strategy for __builtin_va_start. We don't have many options, because the type of va_list is determined by the ABI and the behavior of __builtin_va_start is defined by GCC, but we may be able to (for instance) inject a "#define __builtin_va_start(list, ...) __builtin_va_start_ptr(&(list), __VA_ARGS__)" rather than using a reference type.
On Thu, Aug 8, 2013 at 12:43 AM, Artyom Skrobov <[email protected]>wrote: > Richard, my patch doesn’t add support for reference types in C – it only > adds the proper type-checking so that clang emits a meaningful error > diagnostic in this case, instead of crashing with a segfault.**** > > ** ** > > ** ** > > *From:* [email protected] [mailto:[email protected]] *On Behalf Of *Richard > Smith > *Sent:* 08 August 2013 00:57 > *To:* Artyom Skrobov > *Cc:* Anton Korobeynikov; [email protected] > > *Subject:* Re: [PATCH] in C mode, __builtin_va_start tries to accept a > reference, sees a record, decides it's a C++ class, then crashes because it > isn't**** > > ** ** > > This is truly hideous. Do we *really* want to support reference types in > C, just so that we can handle __builtin_va_start?**** > > ** ** > > On Tue, Aug 6, 2013 at 8:26 AM, Artyom Skrobov <[email protected]> > wrote:**** > > Anton, thank you for your suggestion. > > Re-submitting the patch as an attachment.**** > > > > -----Original Message----- > From: Anton Korobeynikov [mailto:[email protected]] > Sent: 05 August 2013 23:24 > To: Artyom Skrobov > Cc: [email protected] > Subject: Re: [PATCH] in C mode, __builtin_va_start tries to accept a > reference, sees a record, decides it's a C++ class, then crashes because it > isn't > > Please consider reading > http://llvm.org/docs/DeveloperPolicy.html#making-a-patch > > > **** > > -- IMPORTANT NOTICE: The contents of this email and any attachments are > confidential and may also be privileged. If you are not the intended > recipient, please notify the sender immediately and do not disclose the > contents to any other person, use it for any purpose, or store or copy the > information in any medium. Thank you.**** > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits**** > > ** ** > > -- IMPORTANT NOTICE: The contents of this email and any attachments are > confidential and may also be privileged. If you are not the intended > recipient, please notify the sender immediately and do not disclose the > contents to any other person, use it for any purpose, or store or copy the > information in any medium. Thank you. >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
