"Fossies" - the Fresh Open Source Software Archive

Member "RPerl-5.002000/docs/learning_rperl_need_add.txt" (30 Aug 2019, 1349 Bytes) of package /linux/misc/RPerl-5.002000.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "learning_rperl_need_add.txt" see the Fossies "Dox" file reference documentation.

    1 [ GCC Warnings & Errors ]
    2 
    3 ===== ===== ===== ===== ===== ===== ===== ===== ===== =====
    4 
    5 # GCC WARNING
    6 comparison between signed and unsigned integer expressions
    7 
    8 # EXPLANATION
    9 Perl `scalar` operation compiles to C++ `size()` function w/ return type unsigned_integer
   10 index variable `i` must also be unsigned_integer to avoid warning
   11 
   12 # PERL INPUT, INCORRECT
   13 for my integer $i ( 0 .. ( ( scalar @{ $self->{bodies} } ) - 1 ) ) { ... }
   14 
   15 # C++ OUTPUT, INCORRECT
   16 integer i;
   17 for ( i = 0; i < (this->bodies.size()); i++ ) { ... }
   18 
   19 # PERL INPUT, CORRECT
   20 for my unsigned_integer $i ( 0 .. ( ( scalar @{ $self->{bodies} } ) - 1 ) ) { ... }
   21 
   22 # C++ OUTPUT, CORRECT
   23 unsigned_integer i;
   24 for ( i = 0; i < (this->bodies.size()); i++ ) { ... }
   25 
   26 ===== ===== ===== ===== ===== ===== ===== ===== ===== =====
   27 
   28 # GCC WARNING
   29 
   30 # EXPLANATION
   31 
   32 # PERL INPUT, INCORRECT
   33 
   34 # C++ OUTPUT, INCORRECT
   35 
   36 # PERL INPUT, CORRECT
   37 
   38 # C++ OUTPUT, CORRECT
   39 
   40 ===== ===== ===== ===== ===== ===== ===== ===== ===== =====
   41 
   42 # GCC WARNING
   43 
   44 # EXPLANATION
   45 
   46 # PERL INPUT, INCORRECT
   47 
   48 # C++ OUTPUT, INCORRECT
   49 
   50 # PERL INPUT, CORRECT
   51 
   52 # C++ OUTPUT, CORRECT
   53 
   54 ===== ===== ===== ===== ===== ===== ===== ===== ===== =====
   55 
   56 # GCC WARNING
   57 
   58 # EXPLANATION
   59 
   60 # PERL INPUT, INCORRECT
   61 
   62 # C++ OUTPUT, INCORRECT
   63 
   64 # PERL INPUT, CORRECT
   65 
   66 # C++ OUTPUT, CORRECT
   67 
   68 ===== ===== ===== ===== ===== ===== ===== ===== ===== =====
   69