[Botan-devel] FW: Botan patch for MSVC warning level 4

Jack Lloyd lloyd at randombit.net
Wed Sep 17 15:56:50 EDT 2008


Hi Tim,

Thanks, this patch looks sound and I will apply to the next 1.7 release.

Am I correct in deducing from the file pathnames in the patch that
Botan is part of Pirates of the Burning Sea? If so, would it be OK to
add a link at http://botan.randombit.net to Flying Lab as a known user
of the library?

Regards,
  Jack

On Wed, Sep 17, 2008 at 11:39:53AM -0700, Tim Burris wrote:
> I submitted this patch but it bounced.
> 
> -----Original Message-----
> From: botan-devel-bounces at randombit.net
> [mailto:botan-devel-bounces at randombit.net] On Behalf Of
> botan-devel-owner at randombit.net
> Sent: Wednesday, September 17, 2008 6:44 AM
> To: Tim Burris
> Subject: Botan patch for MSVC warning level 4
> 
> You are not allowed to post to this mailing list, and your message has
> been automatically rejected.  If you think that your messages are
> being rejected in error, contact the mailing list owner at
> botan-devel-owner at randombit.net.
> 

> From: Tim Burris <timb at flyinglab.com>
> To: botan-devel at randombit.net
> Date: Sun, 7 Sep 2008 13:09:32 -0700
> Subject: Botan patch for MSVC warning level 4
> 
> The MSVC compiler complains about some classes in the Botan headers
> under /W4 because they contain const instance members.  See
> http://msdn.microsoft.com/en-us/library/hsyx7kbz(VS.80).aspx for more
> info.
> 
> Please find attached a patch that resolves this warning by explicitly
> disabling the assignment operator for these classes.  Patch is in
> unified diff format as output by Perforce.
> 



-------------- next part --------------
==== //pirates/build/src/sdk/Botan/build/include/botan/base.h#1 - C:/pirates\build\src\sdk\Botan\build\include\botan\base.h ====
@@ -33,6 +33,8 @@
       virtual ~SymmetricAlgorithm() {}
    private:
       virtual void key(const byte[], u32bit) = 0;
+	  // Declaring inaccessible assignment operator
+	  SymmetricAlgorithm& operator= (const SymmetricAlgorithm&);
    };
 
 /*************************************************
@@ -56,6 +58,8 @@
    private:
       virtual void enc(const byte[], byte[]) const = 0;
       virtual void dec(const byte[], byte[]) const = 0;
+	  // Declaring inaccessible assignment operator
+	  BlockCipher& operator= (const BlockCipher&);
    };
 
 /*************************************************
@@ -80,6 +84,8 @@
       virtual ~StreamCipher() {}
    private:
       virtual void cipher(const byte[], byte[], u32bit) = 0;
+	  // Declaring inaccessible assignment operator
+	  StreamCipher& operator= (const StreamCipher&);
    };
 
 /*************************************************
@@ -103,6 +109,8 @@
    private:
       virtual void add_data(const byte[], u32bit) = 0;
       virtual void final_result(byte[]) = 0;
+	  // Declaring inaccessible assignment operator
+	  BufferedComputation& operator= (const BufferedComputation&);
    };
 
 /*************************************************
@@ -119,6 +127,9 @@
 
       HashFunction(u32bit, u32bit = 0);
       virtual ~HashFunction() {}
+   private:
+	  // Declaring inaccessible assignment operator
+	  HashFunction& operator= (const HashFunction&);
    };
 
 /*************************************************
@@ -163,8 +174,6 @@
       u32bit add_entropy(EntropySource&, bool = true);
 
       virtual ~RandomNumberGenerator() {}
-   private:
-      virtual void add_randomness(const byte[], u32bit) = 0;
    };
 
 }
==== //pirates/build/src/sdk/Botan/build/include/botan/pubkey.h#1 - C:/pirates\build\src\sdk\Botan\build\include\botan\pubkey.h ====
@@ -62,6 +62,8 @@
       const PK_Signing_Key& key;
       Signature_Format sig_format;
       EMSA* emsa;
+	  // Declaring inaccessible assignment operator
+	  PK_Signer& operator= (const PK_Signer&);
    };
 
 /*************************************************
@@ -110,6 +112,8 @@
    private:
       const PK_Key_Agreement_Key& key;
       const std::string kdf_name;
+	  // Declaring inaccessible assignment operator
+	  PK_Key_Agreement& operator= (const PK_Key_Agreement&);
    };
 
 /*************************************************
@@ -125,6 +129,8 @@
       SecureVector<byte> enc(const byte[], u32bit) const;
       const PK_Encrypting_Key& key;
       const EME* encoder;
+	  // Declaring inaccessible assignment operator
+	  PK_Encryptor_MR_with_EME& operator= (const PK_Encryptor_MR_with_EME&);
    };
 
 /*************************************************
@@ -139,6 +145,8 @@
       SecureVector<byte> dec(const byte[], u32bit) const;
       const PK_Decrypting_Key& key;
       const EME* encoder;
+	  // Declaring inaccessible assignment operator
+	  PK_Decryptor_MR_with_EME& operator= (const PK_Decryptor_MR_with_EME&);
    };
 
 /*************************************************
@@ -154,6 +162,8 @@
       u32bit key_message_part_size() const { return key.message_part_size(); }
 
       const PK_Verifying_with_MR_Key& key;
+	  // Declaring inaccessible assignment operator
+	  PK_Verifier_with_MR& operator= (const PK_Verifier_with_MR&);
    };
 
 /*************************************************
@@ -169,6 +179,8 @@
       u32bit key_message_part_size() const { return key.message_part_size(); }
 
       const PK_Verifying_wo_MR_Key& key;
+	  // Declaring inaccessible assignment operator
+	  PK_Verifier_wo_MR& operator= (const PK_Verifier_wo_MR&);
    };
 
 }
==== //pirates/build/src/sdk/Botan/build/include/botan/ui.h#1 - C:/pirates\build\src\sdk\Botan\build\include\botan\ui.h ====
@@ -26,6 +26,9 @@
    protected:
       const std::string preset_passphrase;
       mutable bool first_try;
+   private:
+	  // Declaring inaccessible assignment operator
+	  User_Interface& operator= (const User_Interface&);
    };
 
 }


More information about the botan-devel mailing list