text
stringlengths
115
796
<s>[INST] find the error in this code: #include "c_standards.h" SINT_32 static_12(SINT_32 p_1, SINT_32 p_2) { SINT_32 i = 1; SINT_32 j = 0; if (p_1 > 0) { i = i - 1; } else i = i + 1; if (p_2 > 0) { j = j + p_2; } else if (p_2 < 0) { j = j - p_2; } else { j = i; } return j; } [/INST] The error is erreur de syntax </s>
<s>[INST] find the error in this code: #include "c_standards.h" #define ArraySize 3.0F void static_109(void) { UINT_32 fl_arr[ (UINT_32) ArraySize ] = {0,1,2}; } [/INST] The error is la taille d'un tableau en C doit être spécifiée en utilisant un entier </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_110(void) { } [/INST] The error is la fonction est vide </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_111(void) { SINT_32 jump_flag = 0; start: jump_flag++; if (jump_flag < 10) { goto start; } } [/INST] The error is L'utilisation de l'instruction goto peut rendre le code difficile à lire et à maintenir </s>
<s>[INST] find the error in this code: #include "c_standards.h" typedef SINT_32 mytype; typedef struct st1 { SINT_32 a; SINT_32 b; } st1; void static_112(void) { typedef FLOAT_32 mytype; } [/INST] The error is confusion, même alias de type avec une signification différente à l'intérieur de la fonction </s>
<s>[INST] find the error in this code: #include "c_standards.h" #include <wchar.h> void static_113(void) { CHAR non_std_char = 'ù'; CHAR *poss_string = "$Id: 56$"; wchar_t non_std_wchar = L'ù'; } [/INST] The error is utilisation des caractères qui ne sont pas conformes au jeu de caractères standard ASCII </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_114(BOOL bl, UINT_32 a) { UINT_32 x; BOOL flag; flag = bl + bl; if (a) { ; } if (1 && bl) { ; } x = ( a && bl ? 1U : 0U ); } [/INST] The error is Dans la deuxième condition if (1 && bl), la condition 1 est toujours vraie, donc la vérification de bl est redondante. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_115(void) { CHAR* str1 = "string\ literal"; CHAR* str2 = "string literal"; } [/INST] The error is problème de continuation de la chaîne sur plusieurs lignes. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_116 (void) { UINT_32 x = 2u; if ( x == 1u ) { ; } if ( x != 0u ) { ; } } [/INST] The error is Pas d'erreur </s>
<s>[INST] find the error in this code: #include "c_standards.h" void main(void) { } [/INST] The error is la fonction main doit toujours renvoyer un entier. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_13(void) { SINT_32 jump_flag = 0; start: jump_flag++; if (jump_flag < 10) { goto start; } } [/INST] The error is The use of goto is usually considered bad practice, as its use leads to code that can be difficult to read and maintain. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_119(void) { UINT_32 x; x = 2U // /* - not compliant + 5U // */ ; /* User might expect +5U to be commented out */ /* This is the Outer Comment /* This is the Inner Comment - not compliant */ } [/INST] The error is Nested comment found </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_120(void) { SINT_32 b = 1; b = b | 1; } [/INST] The error is Use of bit operator on signed type. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_121(void) { BOOL flag = FALSE; switch (flag) { case TRUE: break; case FALSE: break; default: break; } } [/INST] The error is Use of boolean expression in switch. </s>
<s>[INST] find the error in this code: #include "c_standards.h" #include <stdlib.h> void static_122(BOOL flag) { if (flag) { abort(); } exit(0); } [/INST] The error is Use of abort, exit, etc. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_123(void) { enum E_type { Enum1, Enum2 , Enum3}; UINT_32 ui; ui = Enum1; } [/INST] The error is Use of underlying enum representation value. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_124(void) { SINT_32 x = 1; ++x; } [/INST] The error is Use of prefix ++ or --. </s>
<s>[INST] find the error in this code: #include "c_standards.h" #include <stdio.h> #define cat(x) (&string[##(x)]) void static_125( UCHAR string[50], UINT_32 n) { UCHAR *token1; token1 = cat(n); } [/INST] The error is Use of ## or # in a macro. </s>
<s>[INST] find the error in this code: #include "c_standards.h" #define MISMATCHEDIF 1 #if MISMATCHEDIF == 1 void static_126(void) { } [/INST] The error is A #if has no #endif in the same file. </s>
<s>[INST] find the error in this code: #include "c_standards.h" INT_32 garray[]; void static_127( INT_32 par[] ) { INT_32 array[] = {0,1,2}; } [/INST] The error is Array has no bounds specified. </s>
<s>[INST] find the error in this code: #include "c_standards.h" UINT_32 global_int = 0; void static_128(UINT_32* global_int) { } [/INST] The error is Parameter has same name as global variable. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void test_14s(SINT_32 p_1) { } void static_14(void (*p_proc_pointer)(SINT_32 parameter_1) ) { p_proc_pointer = test_14s; } [/INST] The error is Procedural parameter declared. </s>
<s>[INST] find the error in this code: #include "c_standards.h" struct DUPLICATE { UINT_32 field1; UINT_32 field2; }; void static_129(UINT_32 DUPLICATE) { } [/INST] The error is Parameter has same name as type or tag. </s>
<s>[INST] find the error in this code: #include <stdio.h> void static_130 (void) { } [/INST] The error is Included file is not permitted. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void STATIC_131(UINT_32 p_1) { UINT_32 static_131; BOOL c_1 = FALSE; if (c_1) { UINT_32 static_131 = 1u; static_131 = static_131 + 1u; } static_131 = p_1; } [/INST] The error is Name reused in inner scope. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_132(void) { BOOL flag = FALSE; if (flag = FALSE) { } } [/INST] The error is Assignment operator in boolean expression. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_133(void) { BOOL flag = FALSE; INT_32 y = 0, x = 0; if ( flag && ((x = y) == 0) ) { } } [/INST] The error is Assignment operator in RHS of && or ||. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_134(void) { UINT_32 y = 2u, x = 0u, z = 1u; volatile UINT_32 v = 1U; UINT_32 arr[2] = { v, 1U }; x = (v + z) / (v * y); } [/INST] The error is Volatile variable in complex expression. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_135( p_1, p_2) UINT_32 p_1; UINT_32 p_2; { } [/INST] The error is Parameter list is KR. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_136(void) { UINT_32 x = 1u; BOOL flag = FALSE; if ((flag | (x != 0u)) == FALSE) { } } [/INST] The error is Bit operator with boolean operand. </s>
<s>[INST] find the error in this code: #include "c_standards.h" struct s_138 {UINT_32 x, :2;}; void static_138(void) { } [/INST] The error is Anonymous bit field used in structure. </s>
<s>[INST] find the error in this code: #define defval 0 typedef enum { LANE_0 = 0, LANE_1 = 1, LANE_LAST = 3 } lane_t; extern lane_t get_lane ( void ); void static_139( void ) { lane_t lane = get_lane(); if ( (lane > LANE_0) && ( lane <= LANE_LAST)) { } if (defval) { } } [/INST] The error is Construct leads to infeasible code. </s>
<s>[INST] find the error in this code: static void static_16(void) { start:begin: ; } [/INST] The error is Multiple labels declared. </s>
<s>[INST] find the error in this code: #include "c_standards.h" #define defval 0 #define LOOP(x) do { x } while (0) void static_140(void) { while (0) { } while( defval ) { } do { } while (0); LOOP(;); } [/INST] The error is Infeasible loop condition found. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_142(UINT_32 , UINT_16 p_2) { } [/INST] The error is Parameter list declarations are inconsistent. </s>
<s>[INST] find the error in this code: #include "c_standards.h" UINT_32 static_143(UINT_32 p_1) { UINT_32 result; result = p_1{}; return result; } [/INST] The error is Curly brackets used in expression. </s>
<s>[INST] find the error in this code: #include "c_standards.h" FLOAT_32 static_144(FLOAT_32 p_1,FLOAT_32 p_2) { FLOAT_32 result; result = p_1 + p_2; return result; } [/INST] The error is Floating point not permitted. </s>
<s>[INST] find the error in this code: #define static_145 6 #if static_145 i #endif [/INST] The error is #if has invalid expression. </s>
<s>[INST] find the error in this code: #define static_146() ("dummy()") void dummy(void); [/INST] The error is #define with empty parameter list. </s>
<s>[INST] find the error in this code: #ifdef STATIC_147 typedef unsigned char UCHAR; #endif ; void static_147(void) { } [/INST] The error is Spurious characters after preprocessor directive. </s>
<s>[INST] find the error in this code: #include "c_standards.h" static_148(UINT_32 p1); static_148(UINT_32 p1) { } [/INST] The error is No return type for function/procedure. </s>
<s>[INST] find the error in this code: #include "c_standards.h" CHAR *static_149( CHAR *p1); void test_149(void) { CHAR *a = "Query"; CHAR *b; b = static_149(a); } CHAR *static_149( CHAR *p1 ) { static CHAR *newA = "Response"; p1++; p1 = p1+1; p1 = newA; return p1; } [/INST] The error is Reference parameter to procedure is reassigned. </s>
<s>[INST] find the error in this code: #include "c_standards.h" volatile UINT_32 STATIC_150(void); volatile UINT_32 STATIC_150(void) { volatile UINT_32 r; return r; } [/INST] The error is Volatile or const used in function type. </s>
<s>[INST] find the error in this code: static void static_17(void) { _asm { mov eax,01h } } [/INST] The error is Code insert found. </s>
<s>[INST] find the error in this code: #include "c_standards.h" UINT_32 globvar; #define STATIC_151 globvar void static_151 (void) { } [/INST] The error is Use of global variable in macro definition. </s>
<s>[INST] find the error in this code: #include "c_standards.h" #define STATIC_152 3 void static_152 (void) { } [/INST] The error is Use of a comment in a macro definition. </s>
<s>[INST] find the error in this code: #ifdef STATIC_153 #endif void static_153 (void) { } [/INST] The error is Use of a comment in a pre-processor directive. </s>
<s>[INST] find the error in this code: #include "c_standards.h" #ifdef STATIC_155 this acts as a comment, as STATIC_155 is undefined. #endif void static_155 (void) { } [/INST] The error is Comments between preprocessor directives. </s>
<s>[INST] find the error in this code: #include "c_standards.h" #define STATIC_156(x) defined(x) #if STATIC_156(c) UINT_32 var1; #else SINT_32 var1; #endif #define c 1 #if STATIC_156(c) UINT_32 var2; #else SINT_32 var2; #endif void static_156( void ) { } [/INST] The error is Use of 'defined' keyword in macro body. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_157(void) { CHAR arr[6] = ""; CHAR *ptr_arr = arr; CHAR *c = "1234567890"; c[7] = '0'; *(c+6) = '1'; ptr_arr[2] = '2'; } [/INST] The error is Modification of string literal. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_158(void) { INT_32 a1,b1,c1,d1,e1; INT_32 a2,b2,c2,d2,e2; INT_32 a3,b3,c3,d3,e3; if( (a1==0) && (b1==0) && (c1==0) && (d1==0) && (e1==0) && (a2==0) && (b2==0) && (c2==0) && (d2==0) && (e2==0) && (a3==0) && (b3==0) && (c3==0) && (d3==0) && (e3==0) ) { } } [/INST] The error is Expression with more than *** subconditions. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_18(UINT_32 p_1, UINT_32 p_2, UINT_32 p_3, UINT_32 p_4, UINT_32 p_5, UINT_32 p_6, UINT_32 p_7, UINT_32 p_8) { } [/INST] The error is No space between * or & and name in declaration. </s>
<s>[INST] find the error in this code: #include "c_standards.h" #include <stdlib.h> void static_159(void) { CHAR *message = "TEST"; if ( message != NULL ) { } if ( message != 0 ) { } } [/INST] The error is Comparing pointer with zero or NULL. </s>
<s>[INST] find the error in this code: #define A B #define B A #define C D #define D E #define E C main(){ int B; int C; } [/INST] The error is Loop in macro expansion. </s>
<s>[INST] find the error in this code: void Static_163( void ) { } [/INST] The error is Function starts with upper case character. </s>
<s>[INST] find the error in this code: #include <stdio.h> static void proc(void *ptr) { ; } void * a_proc ( void ) { return NULL; } void static_164 ( void ) { void * p = a_proc(); proc(p); } [/INST] The error is Use of void * pointer. </s>
<s>[INST] find the error in this code: #include "c_standards.h" static void aproc( SINT_32 iv_param) {;} static void bproc(const SINT_32 ic_param) {;} static SINT_32 static_168 (void) { SINT_32 loc_var = 0; aproc(loc_var); bproc(loc_var); } [/INST] The error is Call by value parameter not const. </s>
<s>[INST] find the error in this code: #include "c_standards.h" static void static_170( void ); static void static_170( void ) { aproc() ; } [/INST] The error is Procedure call has no prototype and no defn. </s>
<s>[INST] find the error in this code: #include "c_standards.h" UCHAR a; UCHAR a; UCHAR b; UCHAR b = 3; extern UCHAR c; extern UCHAR c; extern UCHAR ok; UCHAR ok = 3U; static void static_172( void ) { ; } [/INST] The error is Variable declared multiply. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_175 (void) { } INT_32 main (void) { } [/INST] The error is Function starts with lower case character. </s>
<s>[INST] find the error in this code: void static_176 (void) { char c = 'b'; switch(c) { case '\m': break; default: break; } } [/INST] The error is Non standard escape sequence in source. </s>
<s>[INST] find the error in this code: #include "c_standards.h" INT_32 okvar, notok2; void static_177(void) { okvar = 0; notok2 = 2; } [/INST] The error is Identifier not declared on new line. </s>
<s>[INST] find the error in this code: #include "c_standards.h" static void static_19( void ( * p_proc_pointer )(void) ) { p_proc_pointer(); } [/INST] The error is Procedural para used in an uncalled procedure. </s>
<s>[INST] find the error in this code: #include "c_standards.h" INT_32 * oka; INT_32 b; INT_32 *notoka; void proc( INT_32 * s, INT_32 *ok); struct tag0 { INT_32 * w; INT_32 *notokq;} astr; static void static_178(void) { oka = 0; } [/INST] The error is Declaration statement not on new line. </s>
<s>[INST] find the error in this code: #include "c_standards.h" #include "Static_179.h" static void static_179(void) { ; } [/INST] The error is Extern not at start of header file. </s>
<s>[INST] find the error in this code: #include "c_standards.h" INT_32 *notoka; typedef INT_32 *ptr; void static_180(INT_32 *p1) { *notoka = *p1; } [/INST] The error is No space between * or & and name in declaration. </s>
<s>[INST] find the error in this code: #include "c_standards.h" INT_32 main(void) { INT_32 i=3; if( 1==2 ) {2;} switch(i){ } switch (i){ } while(i==0){2;} do{2;}while(i==0); for(i=0;i>2;i++){2;} } [/INST] The error is No space between if, while, for and expresn. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_182(void) { INT_32 i; for ( i = 0;i < 5;i++ ) { i++; } } [/INST] The error is No space after semi colon in for expression. </s>
<s>[INST] find the error in this code: #include "c_standards.h" static void static_183(void) { INT_32 i; INT_32 j; for ( i = 0; i < 5; i++ ) { i++;} } [/INST] The error is No newline after semi colon. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_185(void) { INT_32 i=9; INT_32 j=19; INT_32 * p; i = - j; p = & j; * p = 77; *p = * p + 77; } [/INST] The error is Space between unary operator and operand. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_186( void ) { INT_32 i = 9; INT_32 j =8; INT_32 k= 7; UINT_32 x = 3u; UINT_32 y = 17u; i= j; i = j /k; i = j <<k; i = j && k; } [/INST] The error is Space missing before or after binary operator. </s>
<s>[INST] find the error in this code: #include "c_standards.h" INT_32 main(void) { INT_32 iiiiiiiiiiiii = 0; iiiiiiiiiiiii = iiiiiiiiiiiii + iiiiiiiiiiiii + iiiiiiiiiiiii + iiiiiiiiiiiii + iiiiiiiiiiiii; } [/INST] The error is Input line exceeds limit. </s>
<s>[INST] find the error in this code: #include "c_standards.h" UINT_32 static_20_135( p_1 ) { UINT_32 result; result = p_1 * 2; return result; } [/INST] The error is Parameter not declared explicitly. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void static_190( int32_t value ) { int32_t x = 0; if( value == 0 ) { x = 1; } else { x = 0; } } [/INST] The error is { ... } contents not indented by *** spaces. </s>
<s>[INST] find the error in this code: void notokproc1 () { } [/INST] The error is Space between function name and parenthesis. </s>
<s>[INST] find the error in this code: static void proc1(void) { ; } [/INST] The error is Static not on separate line in function defn. </s>
<s>[INST] find the error in this code: static void proc2(void) { } [/INST] The error is Function return type needs a new line. </s>
<s>[INST] find the error in this code: #include "c_standards.h" #define ACONSTAT 100 const INT_16 BCONSTAT = 100; void static_200 ( void ) { INT_16 ss; ss = ACONSTAT; ss = BCONSTAT; } [/INST] The error is Define used for numeric constant. </s>
<s>[INST] find the error in this code: #include "c_standards.h" #define ACONSTANT 101 SINT_32 static_201(void) { const SINT_16 max = 17; SINT_16 y = 77; SINT_16 z; z = 131; z = ACONSTANT; z = 0; z = 1; z = 2; return 0; } [/INST] The error is Use of numeric literal in expression. </s>
<s>[INST] find the error in this code: #include "c_standards.h" const INT_16 con = 19; const INT_16 * pcon; static void static_203(void) { INT_16 x; INT_16 *p; x = (INT_16)con; p = (INT_16 *)pcon; } [/INST] The error is Cast on a constant value. </s>
<s>[INST] find the error in this code: #define goto some_total_rubbish ---------- void static_204 (void) { ; } [/INST] The error is continue or goto not defined to rubbish. </s>
<s>[INST] find the error in this code: #ifndef XXX #define XXX #endif static void static_209( void ) { } [/INST] The error is Preprocessor command indented. </s>
<s>[INST] find the error in this code: #include "c_standards.h" #define my_sq_macro(X) ((X) * (X)) UINT_32 static_210(UINT_32 p1) { return my_sq_macro(p1); } [/INST] The error is Macro name is not upper case. </s>
<s>[INST] find the error in this code: #include "c_standards.h" UINT_32 test_21(UINT_32 p_1, UINT_16 p_2) { UINT_32 result = 0; result = p_1 + p_2; return result; } void static_21(UINT_32 p_1, UINT_16 p_2) { test_21(1u, 2u ,2u); } [/INST] The error is Number of parameters does not match. </s>
<s>[INST] find the error in this code: #include "c_standards.h" static void static_216( void ) { UCHAR * pointer; UCHAR * ptr; UCHAR * aptr; } [/INST] The error is Pointer name does not have required suffix. </s>
<s>[INST] find the error in this code: #include "c_standards.h" INT_32 Foobar; INT_32 foobar; INT_32 fOobar; void aproc(CHAR aC2, INT_32 FooBar) {;} void static_217 (void) { struct tag{ CHAR aC1; INT_32 FooBar;} local; } [/INST] The error is Pointer name does not have required suffix. </s>
<s>[INST] find the error in this code: #include "c_standards.h" void strstr(INT_32 x){;} void strcmp(INT_32 x){;} static void static_218 (void) { strstr(2); strcmp(1); } [/INST] The error is Name is used in standard libraries. </s>
<s>[INST] find the error in this code: #include "c_standards.h" typedef int _INT_NOK; static void static_219 ( void ) { INT_32 _ohno; } [/INST] The error is User name starts with underscore. </s>
<s>[INST] find the error in this code: #include "c_standards.h" struct lower { CHAR c; }; struct Upper { CHAR c; }; union lowerun { CHAR cu; INT_16 iu; }; typedef struct Upper lowstrtype; void static_221 (void) { struct lower s; } [/INST] The error is Start of class/struct/union/enum lower case. </s>
<s>[INST] find the error in this code: #include "c_standards.h" INT_32 ok; INT_32 Notok; void static_222(void) { ok = Notok; } [/INST] The error is Start of variable is upper case. </s>
<s>[INST] find the error in this code: #include "c_standards.h" INT_32 func(INT_32 p){return 7;} INT_32 GLOBpx_func(INT_32 q){return 11;} INT_32 main(void){ } [/INST] The error is No prefix for global function. </s>
<s>[INST] find the error in this code: #include "c_standards.h" enum { red, green, Blue}; void static_224 ( void ) { ; } [/INST] The error is Start of enumeration is upper case. </s>
<s>[INST] find the error in this code: void static_225 ( void ) { ; } [/INST] The error is Inappropriate file extension. </s>
<s>[INST] find the error in this code: typedef unsigned UINT; enum {won=1,too=2}; struct tag{ UINT dec:2; UINT oct:02; UINT hex:0x3; UINT enumr:won; UINT decu:3u; }; void static_226 (void) { ; } [/INST] The error is Bit field is not octal, hex or suffix u. </s>
<s>[INST] find the error in this code: #define COMMON_SYM_CONSTANT ((2U * 3U) + 2U [/INST] The error is Bracket mismatch ( or { in macro definition. </s>
<s>[INST] find the error in this code: #define COMMON_SYM_CONSTANT 2U * 3U + 2U) [/INST] The error is Bracket mismatch ) or } in macro definition. </s>
<s>[INST] find the error in this code: #include "Static_243.h" static void static_243 ( void ) { ; } [/INST] The error is Included file not protected with #define. </s>
<s>[INST] find the error in this code: #include "c_standards.h" typedef enum Choice { first, second, third, fourth } Choice; INT_32 a1 = 1; INT_32 errorflag = 0; static void static_245(Choice chooser) { INT_32 b1 = 2; INT_32 c1 = 1; switch (chooser) { case first: a1 = b1; break; case second: case third: a1 = c1; if (a1 == b1) { case fourth: } break; default: errorflag = 1; break; } } [/INST] The error is Case statement in nested block. </s>
<s>[INST] find the error in this code: #include "c_standards.h" #define COMMON_MACRO(X) (ANOTHER_MACRO(X)) #define SOME_MACRO(X) (NESTED_MACRO1(X)) #define NESTED_MACRO1(X) (NESTED_MACRO2(X)) #define NESTED_MACRO2(X) (COMMON_MACRO(X)) #define ANOTHER_MACRO(X) (X) const SINT_32 s1 = 42; void static_247(void) { SINT_32 myInt = COMMON_MACRO(SOME_MACRO(s1)); } [/INST] The error is Macro definition calls itself. </s>
<s>[INST] find the error in this code: #define DEBUG2 2 #define DEBUG1 0 #define COMMON_MACRO(X,Y) ((X)/(Y)) #if (COMMON_MACRO(DEBUG2,DEBUG1)) == 1 #endif void static_248(void) { } [/INST] The error is Divide by zero in preprocessor directive. </s>