This is the mail archive of the gcc-bugs@gcc.gnu.org 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]

[Bug target/54631] New: vxworks.c fails to compile


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54631

             Bug #: 54631
           Summary: vxworks.c fails to compile
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rbmj@verizon.net


I just pulled in the latest changes, and vxworks.c no longer compiles.  The
error is at bottom.

I think this has to do with the upgrade to C++.  The code in question does
this:

elt = VEC_quick_push(constructor_elt, v, NULL);

The problem with this is that NULL is not convertible to const constructor_elt
&.  I think that with the old C API this would just construct a new object, but
that doesn't work anymore.

Changing the code to construct the object first and then add it to the vector
should work, but I don't know enough about the code to be sure.

As a question, should these files be changed to use the C++ API?  Or should
they stick with pretending that they're straight C?

Thanks!

Robert Mason

../../gcc/gcc/config/vxworks.c: In function âtree_node*
vxworks_emutls_var_init(tree, tree, tree)â:
../../gcc/gcc/config/vxworks.c:105:9: error: no matching function for call to
âvec_t<constructor_elt_d>::quick_push(NULL, const char [31], int, const char
[24])â
../../gcc/gcc/config/vxworks.c:105:9: note: candidate is:
In file included from ../../gcc/gcc/tree.h:29:0,
                 from ../../gcc/gcc/config/vxworks.c:29:
../../gcc/gcc/vec.h:783:1: note: T* vec_t<T>::quick_push(const T&, const char*,
unsigned int, const char*) [with T = constructor_elt_d]
../../gcc/gcc/vec.h:783:1: note:   no known conversion for argument 1 from
âlong intâ to âconst constructor_elt_d&â
../../gcc/gcc/config/vxworks.c:109:9: error: no matching function for call to
âvec_t<constructor_elt_d>::quick_push(NULL, const char [31], int, const char
[24])â
../../gcc/gcc/config/vxworks.c:109:9: note: candidate is:
In file included from ../../gcc/gcc/tree.h:29:0,
                 from ../../gcc/gcc/config/vxworks.c:29:
../../gcc/gcc/vec.h:783:1: note: T* vec_t<T>::quick_push(const T&, const char*,
unsigned int, const char*) [with T = constructor_elt_d]
../../gcc/gcc/vec.h:783:1: note:   no known conversion for argument 1 from
âlong intâ to âconst constructor_elt_d&â
../../gcc/gcc/config/vxworks.c:114:9: error: no matching function for call to
âvec_t<constructor_elt_d>::quick_push(NULL, const char [31], int, const char
[24])â
../../gcc/gcc/config/vxworks.c:114:9: note: candidate is:
In file included from ../../gcc/gcc/tree.h:29:0,
                 from ../../gcc/gcc/config/vxworks.c:29:
../../gcc/gcc/vec.h:783:1: note: T* vec_t<T>::quick_push(const T&, const char*,
unsigned int, const char*) [with T = constructor_elt_d]
../../gcc/gcc/vec.h:783:1: note:   no known conversion for argument 1 from
âlong intâ to âconst constructor_elt_d&â
make[2]: *** [vxworks.o] Error 1
make[1]: *** [all-gcc] Error 2
make: *** [all] Error 2


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