[Bug java/28153] New: Under Windows Xp the generated JNI headers need to have a '_' prepended for each function.

2006-06-24 Thread bcmpinc at hotmail dot com
I had some problems when I tried to compile a JNI-example from wikipedia:
  http://en.wikipedia.org/wiki/JNI

I compiled the Java-source containing the native function 
with 'gcj -C' (gcc version 3.4.2 (mingw-special)):
  public native void sayHello();

I passed the class-file to 'gcjh -jni' and it produced a header with the line:
  extern JNIEXPORT void JNICALL Java_JavaSide_sayHello (JNIEnv *env, jobject);

I implemented the function, compiled it with 'g++ -O2 -shared'
When I tried to run the java class it gave an error when it called the native
function.

I examined some other dll's used by java (with depens.exe) and all the
functions 
had a '_' prepended.
I changed the line in the header file to:
  extern JNIEXPORT void JNICALL _Java_JavaSide_sayHello (JNIEnv *env, jobject);

Recompiled the C++ source and ran the java class. This time the function worked 
without any problems.


-- 
   Summary: Under Windows Xp the generated JNI headers need to have
a '_' prepended for each function.
   Product: gcc
   Version: 3.4.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: java
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bcmpinc at hotmail dot com


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



[Bug java/28153] Under Windows Xp the generated JNI headers need to have a '_' prepended for each function.

2006-06-26 Thread bcmpinc at hotmail dot com


--- Comment #2 from bcmpinc at hotmail dot com  2006-06-26 21:01 ---
(In reply to comment #1)
> Does the JDK's javah put that "_" into the generated header?
No, JDK's javah creates a header equivalent to the header created by 'gcjh
-jni'.

> I suspect that you are seeing a problem with the C compiler, not a problem
> with JNI header generation.
I tried compiling with JDK's jni-headers and the javah-header. It still needs
the "_" prepended.

> In particular I think that "_", most likely, should be added by the C
> compiler and not added to the header.
I think you're right, but it's strange that the C compiler should recognize
that it's compiling a native java function. Most exported non-java functions
don't have a "_" prepended, even if they're in a library containing a lot of
java functions.


-- 


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



[Bug java/28153] Under Windows Xp the generated JNI headers need to have a '_' prepended for each function.

2006-07-06 Thread bcmpinc at hotmail dot com


--- Comment #7 from bcmpinc at hotmail dot com  2006-07-06 12:37 ---

extern JNIEXPORT void JNICALL Java_JavaSide_sayHello (JNIEnv *env, jobject);

After preprossesing this becomes:

__attribute__((dllexport)) void __attribute__((__stdcall__))
Java_sample_myNative
  (JNIEnv *, jobject, jstring);


-- 


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



[Bug preprocessor/52852] New: The preprocessor fails to parse multi-line c++0x/c++11 raw strings.

2012-04-03 Thread bcmpinc at hotmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52852

 Bug #: 52852
   Summary: The preprocessor fails to parse multi-line c++0x/c++11
raw strings.
Classification: Unclassified
   Product: gcc
   Version: 4.6.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: preprocessor
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: bcmp...@hotmail.com


When compiling the following piece of code, using "g++ -v -save-temps a.cpp
-std=c++0x", the preprocessor fails to parse it correctly. This causes the
compilation to fail.

#include 
#define log(a) printf("%s\n", a)
int main() {
log(R"delimiter(
Multi
line
raw
string
)delimiter");
}

The -save-temps output is attached.


[Bug c++/59378] New: Internal compiler error when using __builtin_shuffle in a template function

2013-12-03 Thread bcmpinc at hotmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59378

Bug ID: 59378
   Summary: Internal compiler error when using __builtin_shuffle
in a template function
   Product: gcc
   Version: 4.8.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bcmpinc at hotmail dot com

The g++ compiler crashes on an internal error when instantiating a template
function or class that uses the gcc vector extensions and __builtin_shuffle().
See attachment.

The error message when instantiating a template function:
test.cpp:4:23: internal compiler error: in make_decl_rtl, at varasm.c:1140

The error message when instantiating a template class:
test2.cpp:5:17: internal compiler error: in gimple_expand_cfg, at
cfgexpand.c:4575


[Bug c++/59378] Internal compiler error when using __builtin_shuffle in a template function

2013-12-03 Thread bcmpinc at hotmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59378

--- Comment #1 from Bauke Conijn  ---
Created attachment 31368
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31368&action=edit
Testcase 1


[Bug c++/59378] Internal compiler error when using __builtin_shuffle in a template function

2013-12-03 Thread bcmpinc at hotmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59378

--- Comment #2 from Bauke Conijn  ---
Created attachment 31369
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31369&action=edit
Testcase 2


[Bug c++/59378] Internal compiler error when using __builtin_shuffle in a template function

2013-12-03 Thread bcmpinc at hotmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59378

Bauke Conijn  changed:

   What|Removed |Added

  Attachment #31367|0   |1
is obsolete||

--- Comment #3 from Bauke Conijn  ---
Created attachment 31370
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31370&action=edit
Verbose compiler output for testcase 1

Generated using: g++ -v -save-temps -std=c++11 test.cpp 2> save-temps


[Bug debug/60380] New: [C++11] ICE: in gen_type_die_with_usage with -g and template instantiation

2014-03-01 Thread bcmpinc at hotmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60380

Bug ID: 60380
   Summary: [C++11] ICE: in gen_type_die_with_usage with -g and
template instantiation
   Product: gcc
   Version: 4.8.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bcmpinc at hotmail dot com

Created attachment 32237
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32237&action=edit
A minimal testcase triggering the ICE

GCC crashes with an ICE, when trying to generate the debug information of a
template class that contains a function that cannot be instantiated due to
substitution failure.

A minimal testcase and compiler output are attached. The testcase was compiled
with:

g++ -v -save-temps -std=c++11 -g testcase.cpp 2> output.txt


[Bug debug/60380] [C++11] ICE: in gen_type_die_with_usage with -g and template instantiation

2014-03-01 Thread bcmpinc at hotmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60380

--- Comment #1 from Bauke Conijn  ---
Created attachment 32238
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32238&action=edit
Compiler output


[Bug debug/60380] [C++11] ICE: in gen_type_die_with_usage with -g and template instantiation

2014-03-01 Thread bcmpinc at hotmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60380

--- Comment #2 from Bauke Conijn  ---
Bug 53756 is possibly related.


[Bug c++/63606] New: Missing a warning for binding a reference member to a stack allocated parameter

2014-10-20 Thread bcmpinc at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63606

Bug ID: 63606
   Summary: Missing a warning for binding a reference member to a
stack allocated parameter
   Product: gcc
   Version: 4.8.2
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bcmpinc at hotmail dot com

The code below should produce a warning, as it binds a stack allocated
parameter to a reference member. However, gcc currently does not produce such a
warning.

The code is error prone as it will always result in a dangling reference: the
object being pointed to is destructed when the constructor returns. Similar
buggy code can accidentally be written when one forgets to insert the '&' to
pass-by-reference. Note that the clang compiler does emit a warning, named
-Wdangling-field, for the code below.


struct Bar {
  int a;
};
struct Foo{
  Foo(Bar arg) : bar(arg) {}
  Bar & bar;
};
int main() {
  Bar k;
  Foo oops(k);
  return 0;
}