public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] objc: update documetation and add test-case of constructor/destructor attr.
@ 2016-08-10  9:11 Martin Liška
  2016-08-11  2:53 ` Sandra Loosemore
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Martin Liška @ 2016-08-10  9:11 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 200 bytes --]

Hi.

Following patch clarifies usage of ctor and dtor attributes for Objective C.
Patch survives (on x86_64-linux-gnu):

make -k check-objc RUNTESTFLAGS="execute.exp"

Ready for trunk?
Thanks,
Martin

[-- Attachment #2: 0001-objc-update-documetation-and-add-test-case-of-constr.patch --]
[-- Type: text/x-patch, Size: 1622 bytes --]

From 0fcb15e50905a95d8e824aed45d961b5ddc46479 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Wed, 10 Aug 2016 11:01:49 +0200
Subject: [PATCH] objc: update documetation and add test-case of
 constructor/destructor attr.

gcc/ChangeLog:

2016-08-10  Martin Liska  <mliska@suse.cz>

	* doc/extend.texi: Remove limitation of Objective C for
	__attribute__((constructor)) and __attribute__((destructor)).

gcc/testsuite/ChangeLog:

2016-08-10  Martin Liska  <mliska@suse.cz>

	* objc/execute/construct1.m: New test.
---
 gcc/doc/extend.texi                     |  2 --
 gcc/testsuite/objc/execute/construct1.m | 11 +++++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)
 create mode 100644 gcc/testsuite/objc/execute/construct1.m

diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 5697f3a..cce17aa 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -2485,8 +2485,6 @@ same priority.  The priorities for constructor and destructor
 functions are the same as those specified for namespace-scope C++
 objects (@pxref{C++ Attributes}).
 
-These attributes are not currently implemented for Objective-C@.
-
 @item deprecated
 @itemx deprecated (@var{msg})
 @cindex @code{deprecated} function attribute
diff --git a/gcc/testsuite/objc/execute/construct1.m b/gcc/testsuite/objc/execute/construct1.m
new file mode 100644
index 0000000..3de036d
--- /dev/null
+++ b/gcc/testsuite/objc/execute/construct1.m
@@ -0,0 +1,11 @@
+int i;
+
+void hello (void) __attribute__ ((constructor));
+void hello (void) { i = 1; }
+
+int main (void) {
+  if (i != 1)
+    return 1;
+
+  return 0;
+}
-- 
2.9.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] objc: update documetation and add test-case of constructor/destructor attr.
  2016-08-10  9:11 [PATCH] objc: update documetation and add test-case of constructor/destructor attr Martin Liška
@ 2016-08-11  2:53 ` Sandra Loosemore
  2016-09-27 12:50   ` Iain Sandoe
  2016-09-27 11:27 ` Martin Liška
  2016-09-28 19:12 ` Mike Stump
  2 siblings, 1 reply; 5+ messages in thread
From: Sandra Loosemore @ 2016-08-11  2:53 UTC (permalink / raw)
  To: Martin Liška, GCC Patches

On 08/10/2016 03:11 AM, Martin Liška wrote:
> Hi.
>
> Following patch clarifies usage of ctor and dtor attributes for Objective C.
> Patch survives (on x86_64-linux-gnu):
>
> make -k check-objc RUNTESTFLAGS="execute.exp"
>
> Ready for trunk?

The documentation fix looks fine, but probably an objc maintainer needs 
to confirm that it's not just an accident that the test case works.

-Sandra

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] objc: update documetation and add test-case of constructor/destructor attr.
  2016-08-10  9:11 [PATCH] objc: update documetation and add test-case of constructor/destructor attr Martin Liška
  2016-08-11  2:53 ` Sandra Loosemore
@ 2016-09-27 11:27 ` Martin Liška
  2016-09-28 19:12 ` Mike Stump
  2 siblings, 0 replies; 5+ messages in thread
From: Martin Liška @ 2016-09-27 11:27 UTC (permalink / raw)
  To: GCC Patches; +Cc: mikestump, iain

ping^1, CC'ing objective C maintainers.

Thanks,
Martin

On 08/10/2016 11:11 AM, Martin Liška wrote:
> Hi.
> 
> Following patch clarifies usage of ctor and dtor attributes for Objective C.
> Patch survives (on x86_64-linux-gnu):
> 
> make -k check-objc RUNTESTFLAGS="execute.exp"
> 
> Ready for trunk?
> Thanks,
> Martin
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] objc: update documetation and add test-case of constructor/destructor attr.
  2016-08-11  2:53 ` Sandra Loosemore
@ 2016-09-27 12:50   ` Iain Sandoe
  0 siblings, 0 replies; 5+ messages in thread
From: Iain Sandoe @ 2016-09-27 12:50 UTC (permalink / raw)
  To: Martin Liška; +Cc: GCC Patches, Sandra Loosemore


> On 10 Aug 2016, at 19:53, Sandra Loosemore <sandra@codesourcery.com> wrote:
> 
> On 08/10/2016 03:11 AM, Martin Liška wrote:
>> Hi.
>> 
>> Following patch clarifies usage of ctor and dtor attributes for Objective C.
>> Patch survives (on x86_64-linux-gnu):
>> 
>> make -k check-objc RUNTESTFLAGS="execute.exp"
>> 
>> Ready for trunk?
> 
> The documentation fix looks fine, but probably an objc maintainer needs to confirm that it's not just an accident that the test case works.

Appologies; traveling this week so won’t be able to give this proper attention until I get back to the office (Mike might have something to add however).

I don’t believe it’s an accident that the test-case works.

Objective-C / Objective-C++ are supposed to be supersets of the parent language, and the test case is pure C compiled with an Objective-C FE (so the underlying C should ‘just work’).

What I don’t expect to be supported is to try to apply that attribute to any Objective-C entity (but I would like to qualify that statement with some double-checking once i’m back in the office).

thanks,
Iain

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] objc: update documetation and add test-case of constructor/destructor attr.
  2016-08-10  9:11 [PATCH] objc: update documetation and add test-case of constructor/destructor attr Martin Liška
  2016-08-11  2:53 ` Sandra Loosemore
  2016-09-27 11:27 ` Martin Liška
@ 2016-09-28 19:12 ` Mike Stump
  2 siblings, 0 replies; 5+ messages in thread
From: Mike Stump @ 2016-09-28 19:12 UTC (permalink / raw)
  To: Martin Liška; +Cc: GCC Patches

On Aug 10, 2016, at 2:11 AM, Martin Liška <mliska@suse.cz> wrote:
> 
> Following patch clarifies usage of ctor and dtor attributes for Objective C.
> Patch survives (on x86_64-linux-gnu):
> 
> make -k check-objc RUNTESTFLAGS="execute.exp"
> 
> Ready for trunk?

Ok.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-28 19:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-10  9:11 [PATCH] objc: update documetation and add test-case of constructor/destructor attr Martin Liška
2016-08-11  2:53 ` Sandra Loosemore
2016-09-27 12:50   ` Iain Sandoe
2016-09-27 11:27 ` Martin Liška
2016-09-28 19:12 ` Mike Stump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).