Front page | perl.perl6.internals |
Postings from January 2002
Re: [PATCH] class/*.c weren't being compiled with warnings turnedon.
Thread Previous
|
Thread Next
From:
Simon Glover
Date:
January 15, 2002 08:20
Subject:
Re: [PATCH] class/*.c weren't being compiled with warnings turnedon.
Message ID:
Pine.LNX.4.33.0201151259490.663-100000@relnx02.roe.ac.uk
On Mon, 14 Jan 2002, Nicholas Clark wrote:
> On Sun, Jan 13, 2002 at 02:14:08PM -0500, Dan Sugalski wrote:
> > So, I'm turning off the unused parameter warning for now to shut the .ops
> > file compiles up. After that point, all submitted patches must generate no
> > more warnings than were currently being generated, and all submitted
> > patches must *not* generate warnings in the areas they patch.
>
> According to the letter of that, this patch isn't acceptable because it
> causes warnings not previously seen to appear.
>
> All the C files in classes/ weren't being compiled with an of the gcc
> warnings flags. With this patch they are, and there are an awful lot of
> warnings, more than I could hope to understand and clear up (within any
> sensible time period before submitting a rash of patches, by which time
> everyone else would have moved the code on)
>
> Pragmatically I believe it's better to apply it than not, but the raft of
> warnings it now creates will obscure any "real" new ones.
>
Most of the new warnings seem to be from two distinct sources.
The majority are of the form:
warning: no previos prototype for `Parrot_...'
while most of the rest are:
warning: control reaches end of non-void function
I'm not sure what to do about the former. The latter generally seem to
arise from unimplemented methods. Accordingly, I've added a new
exception, PMC_FN_NOT_IMPLEMENTED, to exception.h, and I'm working on
getting all of the currently unimplemented methods to throw this
exception. Patches below to exception.h and to perlnum.pmc - patches
for the other PMCs will follow shortly.
Ultimately, we'll want to change some of these exceptions to something
more informative, as some of these methods should never be implemented;
for instance, calling set_integer_index on a PerlNum doesn't make much
sense. This should do for the time being, however.
Simon
--- include/parrot/exceptions.h.old Tue Jan 15 12:39:38 2002
+++ include/parrot/exceptions.h Tue Jan 15 12:57:29 2002
@@ -39,6 +39,7 @@
#define PARROT_POINTER_ERROR 1
#define DIV_BY_ZERO 1
#define IO_NOT_IMPLEMENTED 1
+#define PMC_FN_NOT_IMPLEMENTED 1
#endif
--- classes/perlnum.pmc.old Tue Jan 15 12:41:23 2002
+++ classes/perlnum.pmc Tue Jan 15 12:57:15 2002
@@ -32,7 +32,9 @@
}
void morph (INTVAL type) {
-fprintf(stderr,"morph not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->morph not implemented\n");
+ return;
}
BOOLVAL move_to (void * destination) {
@@ -44,6 +46,9 @@
}
void destroy () {
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->destroy not implemented\n");
+ return;
}
INTVAL get_integer () {
@@ -51,6 +56,9 @@
}
INTVAL get_integer_index (INTVAL index) {
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->get_integer_index not implemented\n");
+ return 0;
}
FLOATVAL get_number () {
@@ -58,6 +66,9 @@
}
FLOATVAL get_number_index (INTVAL index) {
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->get_number_index not implemented\n");
+ return 0;
}
STRING* get_string () {
@@ -74,6 +85,9 @@
}
STRING* get_string_index (INTVAL index) {
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->get_string_index not implemented\n");
+ return NULL;
}
BOOLVAL get_bool () {
@@ -101,6 +115,9 @@
}
void set_integer_bigint (BIGINT value) {
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->set_integer_bigint not implemented\n");
+ return;
}
void set_integer_same (PMC * value) {
@@ -109,6 +126,9 @@
}
void set_integer_index (INTVAL value, INTVAL index) {
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->set_integer_index not implemented\n");
+ return;
}
void set_number (PMC * value) {
@@ -120,7 +140,9 @@
}
void set_number_bigfloat (BIGFLOAT value) {
-fprintf(stderr,"set_number_bigfloat not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->set_number_bigfloat not implemented\n");
+ return;
}
void set_number_same (PMC * value) {
@@ -128,6 +150,9 @@
}
void set_number_index (FLOATVAL value, INTVAL index) {
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->set_number_index not implemented\n");
+ return;
}
void set_string (PMC * value) {
@@ -156,10 +181,15 @@
}
void set_string_index (STRING* value, INTVAL index) {
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->set_string_index not implemented\n");
+ return;
}
void set_value (void* value) {
-fprintf(stderr,"set_value not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->set_value not implemented\n");
+ return;
}
void add (PMC * value, PMC* dest) {
@@ -191,15 +221,21 @@
}
void add_bigint (BIGINT value, PMC* dest) {
-fprintf(stderr,"add_bigint not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->add_bigint not implemented\n");
+ return;
}
void add_float (FLOATVAL value, PMC* dest) {
-fprintf(stderr,"add_float not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->add_float not implemented\n");
+ return;
}
void add_bigfloat (BIGFLOAT value, PMC* dest) {
-fprintf(stderr,"add_bigfloat not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->add_bigfloat not implemented\n");
+ return;
}
void add_same (PMC * value, PMC* dest) {
@@ -232,15 +268,21 @@
}
void subtract_bigint (BIGINT value, PMC* dest) {
-fprintf(stderr,"subtract_bigint not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->subtract_bigint not implemented\n");
+ return;
}
void subtract_float (FLOATVAL value, PMC* dest) {
-fprintf(stderr,"subtract_float not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->subtract_float not implemented\n");
+ return;
}
void subtract_bigfloat (BIGFLOAT value, PMC* dest) {
-fprintf(stderr,"subtract_bigfloat not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->subtract_bigfloat not implemented\n");
+ return;
}
void subtract_same (PMC * value, PMC* dest) {
@@ -273,15 +315,21 @@
}
void multiply_bigint (BIGINT value, PMC* dest) {
-fprintf(stderr,"multiply_bigint not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->multiply_bigint not implemented\n");
+ return;
}
void multiply_float (FLOATVAL value, PMC* dest) {
-fprintf(stderr,"multiply_float not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->multiply_float not implemented\n");
+ return;
}
void multiply_bigfloat (BIGFLOAT value, PMC* dest) {
-fprintf(stderr,"multiply_bigfloat not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->multiply_bigfloat not implemented\n");
+ return;
}
void multiply_same (PMC * value, PMC* dest) {
@@ -314,15 +362,21 @@
}
void divide_bigint (BIGINT value, PMC* dest) {
-fprintf(stderr,"divide_bigint not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->divide_bigint not implemented\n");
+ return;
}
void divide_float (FLOATVAL value, PMC* dest) {
-fprintf(stderr,"divide_float not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->divide_float not implemented\n");
+ return;
}
void divide_bigfloat (BIGFLOAT value, PMC* dest) {
-fprintf(stderr,"divide_bigfloat not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->divide_bigfloat not implemented\n");
+ return;
}
void divide_same (PMC * value, PMC* dest) {
@@ -330,27 +384,39 @@
}
void modulus (PMC * value, PMC* dest) {
-fprintf(stderr,"modulus not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->modulus not implemented\n");
+ return;
}
void modulus_int (INTVAL value, PMC* dest) {
-fprintf(stderr,"modulus_int not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->modulus_int not implemented\n");
+ return;
}
void modulus_bigint (BIGINT value, PMC* dest) {
-fprintf(stderr,"modulus_bigint not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->modulus_bigint not implemented\n");
+ return;
}
void modulus_float (FLOATVAL value, PMC* dest) {
-fprintf(stderr,"modulus_float not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->modulus_float not implemented\n");
+ return;
}
void modulus_bigfloat (BIGFLOAT value, PMC* dest) {
-fprintf(stderr,"modulus_bigfloat not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->modulus_bigfloat not implemented\n");
+ return;
}
void modulus_same (PMC * value, PMC* dest) {
-fprintf(stderr,"modulus_same not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->modulus_same not implemented\n");
+ return;
}
void concatenate (PMC * value, PMC* dest) {
@@ -420,42 +486,62 @@
void logical_not (PMC* value) = default;
void match (PMC * value,REGEX* re) {
-fprintf(stderr,"match not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->match not implemented\n");
+ return;
}
void match_native (STRING * value, REGEX* re) {
-fprintf(stderr,"match_native not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->match_native not implemented\n");
+ return;
}
void match_unicode (STRING * value, REGEX* re) {
-fprintf(stderr,"match_unicode not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->match_unicode not implemented\n");
+ return;
}
void match_other (STRING * value, REGEX* re) {
-fprintf(stderr,"match_other not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->match_other not implemented\n");
+ return;
}
void match_same (PMC * value,REGEX* re) {
-fprintf(stderr,"match_same not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->match_same not implemented\n");
+ return;
}
void repeat (PMC * value, PMC* dest) {
-fprintf(stderr,"repeat not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->repeat not implemented\n");
+ return;
}
void repeat_native (STRING * value, PMC* dest) {
-fprintf(stderr,"repeat_native not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->repeat_native not implemented\n");
+ return;
}
void repeat_unicode (STRING * value, PMC* dest) {
-fprintf(stderr,"repeat_unicode not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->repeat_unicode not implemented\n");
+ return;
}
void repeat_other (STRING * value, PMC* dest) {
-fprintf(stderr,"repeat_other not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->repeat_other not implemented\n");
+ return;
}
void repeat_same (PMC * value, PMC* dest) {
-fprintf(stderr,"repeat_same not implemented\n");
+ internal_exception(PMC_FN_NOT_IMPLEMENTED,
+ "PerlNum->same not implemented\n");
+ return;
}
}
Thread Previous
|
Thread Next