C++ and Java CNI: Check Java references

Cedric Berger cedric@wireless-networks.com
Tue Apr 24 07:49:00 GMT 2001


Andrew Haley wrote:
> Cedric Berger writes:
> > Shoudn't that be a #pragma put on the top of the CNI file?
>> Rather than a compiler flag, you mean?

Yes, my point is that if you write a piece of CNI code that rely
on this feature (automatic generation of NullPointerException on
NULLs), it's better to advertise that on the source code itself.
something like:
#pragme needs-automatic-java-null-check
Of course, this pragma should do nothing if SEGV already throws
NullPointerException on the platform.
But I'm probably missing something.
> I guess that might work, but it would mean additional configury to
> insert it at the appropriate place. We'd need to be able to recompile
> a library for different targets, some of which would need this option
> and some of which wouldn't, without editing the sources.
>> I guess we could do something like
>> #ifdef CHECK
> #pragma check-java-pointers
> #endif
>> And the use -DCHECK on the compiler command line. But I don't know if
> this is better.
>> Andrew.



More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /