Browse code

app_perl: new parameter to set warn flag for perl parse

Daniel-Constantin Mierla authored on 11/07/2022 06:55:30
Showing 1 changed files
... ...
@@ -72,6 +72,7 @@ int _ap_reset_cycles_init = 0;
72 72
 int _ap_exec_cycles = 0;
73 73
 int *_ap_reset_cycles = 0;
74 74
 int _ap_parse_mode = 0;
75
+static int _ap_warn_mode = 0;
75 76
 
76 77
 /* Reference to the running Perl interpreter instance */
77 78
 PerlInterpreter *my_perl = NULL;
... ...
@@ -125,6 +126,7 @@ static param_export_t params[] = {
125 126
 	{"reset_cycles", INT_PARAM, &_ap_reset_cycles_init},
126 127
 	{"perl_destroy_func",  PARAM_STRING, &perl_destroy_func},
127 128
 	{"parse_mode", PARAM_INT, &_ap_parse_mode},
129
+	{"warn_mode",  PARAM_INT, &_ap_warn_mode},
128 130
 	{ 0, 0, 0 }
129 131
 };
130 132
 
... ...
@@ -185,7 +187,7 @@ EXTERN_C void xs_init(pTHX) {
185 187
  */
186 188
 int parser_init(void) {
187 189
 	int argc = 0;
188
-	char *argv[MAX_LIB_PATHS + 3];
190
+	char *argv[MAX_LIB_PATHS + 6];
189 191
 	char *entry, *stop, *end;
190 192
 	int modpathset_start = 0;
191 193
 	int modpathset_end = 0;
... ...
@@ -208,6 +210,10 @@ int parser_init(void) {
208 210
 
209 211
 	argv[0] = ""; argc++; /* First param _needs_ to be empty */
210 212
 
213
+	if(_ap_warn_mode==1) {
214
+		argv[argc] = "-w"; argc++;
215
+	}
216
+
211 217
 	 /* Possible Include path extension by modparam */
212 218
 	if (modpath && (strlen(modpath) > 0)) {
213 219
 		modpathset_start = argc;