Last Comment Bug 784776 - build fails with clang 3.2
: build fails with clang 3.2
Status: RESOLVED FIXED
[fixed-in-hunspell-1.3.x]
:
Product: Core
Classification: Components
Component: General (show other bugs)
: Trunk
: x86_64 FreeBSD
: -- normal (vote)
: mozilla17
Assigned To: Jan Beich
:
Mentors:
http://svn.freebsd.org/changeset/base...
: 762956 (view as bug list)
Depends on:
Blocks: clang 787730
  Show dependency treegraph
 
Reported: 2012-08-22 13:11 PDT by Jan Beich
Modified: 2014-06-16 13:36 PDT (History)
5 users (show)
ryanvm: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Bug 784776 - Don't assume NULL is numeric. (748 bytes, patch)
2012-08-22 13:17 PDT, Jan Beich
cjones.bugs: review+
Details | Diff | Splinter Review
Bug 784776 - time() wants a pointer as an argument. (903 bytes, patch)
2012-08-22 13:26 PDT, Jan Beich
smontagu: review+
Details | Diff | Splinter Review
Bug 784776 - time() wants a pointer as an argument. (903 bytes, patch)
2012-08-25 05:53 PDT, Jan Beich
smontagu: review+
Details | Diff | Splinter Review
Bug 784776 - Don't assume NULL is numeric. (hunspell) (2.23 KB, patch)
2012-08-25 17:43 PDT, Jan Beich
bugs: review-
Details | Diff | Splinter Review
Bug 784776 - Don't assume NULL is numeric. (hunspell) (2.25 KB, patch)
2012-08-25 19:25 PDT, Jan Beich
bugs: review+
Details | Diff | Splinter Review

Description Jan Beich 2012-08-22 13:11:16 PDT

    
Comment 1 Jan Beich 2012-08-22 13:17:28 PDT
Created attachment 654347 [details] [diff] [review]
Bug 784776 - Don't assume NULL is numeric.

mozilla-central-5b057a27cd0e/ipc/glue/CrossProcessMutex_unimplemented.cpp:43:10: error:
      cannot initialize return object of type 'CrossProcessMutexHandle'
      (aka 'unsigned long') with an rvalue of type 'nullptr_t'
  return NULL;
         ^~~~
/usr/include/sys/_null.h:35:14: note: expanded from macro 'NULL'
                ^~~~~~~
Comment 2 Jan Beich 2012-08-22 13:26:30 PDT
Created attachment 654350 [details] [diff] [review]
Bug 784776 - time() wants a pointer as an argument.

http://pubs.opengroup.org/onlinepubs/009696699/functions/time.html

mozilla-central-5b057a27cd0e/intl/locale/src/unix/nsDateTimeFormatUnix.cpp:103:8: error:
      no matching function for call to 'time'
  tt = time((time_t)NULL);
       ^~~~
/usr/include/time.h:150:8: note: candidate function not viable: no known conversion
      from 'time_t' (aka 'long') to 'time_t *' (aka 'long *') for 1st argument
time_t time(time_t *);
       ^
Comment 3 Jan Beich 2012-08-25 05:53:38 PDT
Created attachment 655302 [details] [diff] [review]
Bug 784776 - time() wants a pointer as an argument.

v2. Follow bug 783206 example and use nullptr.
Comment 4 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-25 17:09:36 PDT
Comment on attachment 654347 [details] [diff] [review]
Bug 784776 - Don't assume NULL is numeric.

Use nullptr if it compiles here.
Comment 5 Jan Beich 2012-08-25 17:23:59 PDT
(In reply to Chris Jones [:cjones] [:warhammer] from comment #4)
> Comment on attachment 654347 [details] [diff] [review]
> Bug 784776 - Don't assume NULL is numeric.
> 
> Use nullptr if it compiles here.

It doesn't (on 103383:e874475efe15).

ipc/glue/CrossProcessMutex_unimplemented.cpp:43:10: error:
      cannot initialize return object of type 'CrossProcessMutexHandle'
      (aka 'unsigned long') with an rvalue of type 'nullptr_t'
  return nullptr;
         ^~~~~~~
1 error generated.
Comment 6 Jan Beich 2012-08-25 17:43:29 PDT
Created attachment 655381 [details] [diff] [review]
Bug 784776 - Don't assume NULL is numeric. (hunspell)

Same as ipc/glue one. A warning turned into an error by -std=gnu++0x.

extensions/spellcheck/hunspell/src/affentry.hxx:87:94: error:
      cannot initialize a parameter of type 'unsigned short' with an rvalue of type
      'nullptr_t'
  ...char * word, int len, char in_compound, const FLAG needflag = NULL);
                                                        ^          ~~~~
extensions/spellcheck/hunspell/src/affentry.hxx:87:94: note:
      passing argument to parameter 'needflag' here
extensions/spellcheck/hunspell/src/affentry.hxx:150:103: error:
      cannot initialize a parameter of type 'unsigned short' with an rvalue of type
      'nullptr_t'
  ...* word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL);
                                                               ^          ~~~~
extensions/spellcheck/hunspell/src/affentry.hxx:150:103: note:
      passing argument to parameter 'needflag' here
2 errors generated.
Comment 7 Olli Pettay [:smaug] 2012-08-25 19:04:28 PDT
Comment on attachment 655381 [details] [diff] [review]
Bug 784776 - Don't assume NULL is numeric. (hunspell)

Shouldn't you use FLAG_NULL ?
Comment 8 Jan Beich 2012-08-25 19:25:45 PDT
Created attachment 655391 [details] [diff] [review]
Bug 784776 - Don't assume NULL is numeric. (hunspell)

(In reply to Olli Pettay [:smaug] from comment #7)
> Shouldn't you use FLAG_NULL ?

FLAG_NULL works, too.
Comment 9 Olli Pettay [:smaug] 2012-08-25 19:46:47 PDT
Though, I think we add a comment about the changes made to Mozilla's tree...
need to find the file where.
Comment 10 Olli Pettay [:smaug] 2012-08-25 19:49:01 PDT
Or maybe not... and this change is trivial anyway.
Comment 11 Jan Beich 2012-08-25 19:53:50 PDT
(In reply to Olli Pettay [:smaug] from comment #9)
> Though, I think we add a comment about the changes made to Mozilla's tree...
> need to find the file where.

Someone else already submitted it upstream.

http://sourceforge.net/tracker/?func=detail&aid=3557292&group_id=143754&atid=756395
Comment 12 Ryan VanderMeulen [:RyanVM] 2012-08-26 06:00:55 PDT
I updated README.hunspell in the Hunspell directory with this bug number before landing.

https://hg.mozilla.org/integration/mozilla-inbound/rev/b5078f2a37dd
https://hg.mozilla.org/integration/mozilla-inbound/rev/77cd258827fd
https://hg.mozilla.org/integration/mozilla-inbound/rev/7dd78bf25baa
Comment 14 Nickolay_Ponomarev 2012-11-18 10:52:03 PST
*** Bug 762956 has been marked as a duplicate of this bug. ***
Comment 15 Ryan VanderMeulen [:RyanVM] 2014-06-16 13:36:42 PDT
This never got upstreamed.

Note You need to log in before you can comment on or make changes to this bug.