This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH]: fix PTHREAD_ONCE_INIT when using -ansi

Kaveh R. Ghazi wrote:
A couple of notes: The fix must not be applied on solaris 10, I found

+ * Sun Solaris defines PTHREAD_ONCE_INIT with a "0" for some
+ *  fields of the pthread_once_t structure, which are of type
+ *  upad64_t, which itself is typedef'd to int64_t, but with __STDC__
+ *  defined (e.g. by -ansi) it is a union. So change the initializer
+ *  to "{0}" instead.  This test relies on solaris_once_init_1.
+ */
+fix = {
+    hackname = solaris_once_init_2;
+    select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
+    files = pthread.h;
+    /*
+     * On Solaris 10, this fix is unnecessary because upad64_t is
+     * always defined correctly regardless of the definition of the
+     * __STDC__ macro.
+     */
+    mach = '*-*-solaris2.1[0-9]*';
+    not_machine = true;

This will select all OS-es other than solaris2.10 and following. How about:

mach = '*-*-solaris2.[1-9]', '*-*-solaris2.[1-9][!0-9]*';

That will catch all pre-10 Solari, regardless of any suffix after
the 5.N gotten from `uname -r`.  (One has to ask, "Why '!' and not '^'?"
Guess:  '^' is the pipe operator, as everyone should know. ;)

Cheers - Bruce

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]